diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 4d3873cc23..119a135230 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -198,7 +198,20 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o else self._last_float_check = self._last_float_check + dtime end - local pos, rou_pos, node + + local pos, rou_pos, node = self.object:get_pos() + local r = 0.6 + for _, node_pos in pairs({{r, 0}, {0, r}, {-r, 0}, {0, -r}}) do + if minetest.get_node(vector.offset(pos, node_pos[1], 0, node_pos[2])).name == "mcl_core:cactus" then + detach_driver(self) + for d = 1, #drop do + minetest.add_item(pos, drop[d]) + end + self.object:remove() + return + end + end + -- Drop minecart if it isn't on a rail anymore if self._last_float_check >= mcl_minecarts.check_float_time then pos = self.object:get_pos() diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index 9a22ee622c..3437076173 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -43,7 +43,7 @@ S("An arrow fired from a bow has a regular damage of 1-9. At full charge, there' S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons."), _doc_items_usagehelp = S("To use arrows as ammunition for a bow, just put them anywhere in your inventory, they will be used up automatically. To use arrows as ammunition for a dispenser, place them in the dispenser's inventory. To retrieve an arrow that sticks in a block, simply walk close to it."), inventory_image = "mcl_bows_arrow_inv.png", - groups = { ammo=1, ammo_bow=1, ammo_bow_regular=1 }, + groups = { ammo=1, ammo_bow=1, ammo_bow_regular=1, ammo_crossbow=1 }, _on_dispense = function(itemstack, dispenserpos, droppos, dropnode, dropdir) -- Shoot arrow local shootpos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) @@ -324,7 +324,9 @@ function ARROW_ENTITY.on_step(self, dtime) end if not obj:is_player() then mcl_burning.extinguish(self.object) - self.object:remove() + if self._piercing == 0 then + self.object:remove() + end end return end diff --git a/mods/ITEMS/mcl_bows/crossbow.lua b/mods/ITEMS/mcl_bows/crossbow.lua new file mode 100644 index 0000000000..e3124156b2 --- /dev/null +++ b/mods/ITEMS/mcl_bows/crossbow.lua @@ -0,0 +1,454 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +mcl_bows_s = {} + +-- local arrows = { +-- ["mcl_bows:arrow"] = "mcl_bows:arrow_entity", +-- } + +local GRAVITY = 9.81 +local BOW_DURABILITY = 385 + +-- Charging time in microseconds +local _BOW_CHARGE_TIME_HALF = 350000 -- bow level 1 +local _BOW_CHARGE_TIME_FULL = 900000 -- bow level 2 (full charge) + +local BOW_CHARGE_TIME_HALF = 350000 -- bow level 1 +local BOW_CHARGE_TIME_FULL = 900000 -- bow level 2 (full charge) + +-- Factor to multiply with player speed while player uses bow +-- This emulates the sneak speed. +local PLAYER_USE_CROSSBOW_SPEED = tonumber(minetest.settings:get("movement_speed_crouch")) / tonumber(minetest.settings:get("movement_speed_walk")) + +-- TODO: Use Minecraft speed (ca. 53 m/s) +-- Currently nerfed because at full speed the arrow would easily get out of the range of the loaded map. +local BOW_MAX_SPEED = 68 + +local function play_load_sound(id, pos) + minetest.sound_play("mcl_bows_crossbow_drawback_"..id, {pos=pos, max_hear_distance=12}, true) +end + +--[[ Store the charging state of each player. +keys: player name +value: +nil = not charging or player not existing +number: currently charging, the number is the time from minetest.get_us_time + in which the charging has started +]] +local bow_load = {} + +-- Another player table, this one stores the wield index of the bow being charged +local bow_index = {} + +function mcl_bows_s.shoot_arrow_crossbow(arrow_item, pos, dir, yaw, shooter, power, damage, is_critical, crossbow_stack, collectable) + local obj = minetest.add_entity({x=pos.x,y=pos.y,z=pos.z}, arrow_item.."_entity") + if power == nil then + power = BOW_MAX_SPEED --19 + end + if damage == nil then + damage = 3 + end + local knockback + if crossbow_stack then + local enchantments = mcl_enchanting.get_enchantments(crossbow_stack) + if enchantments.piercing then + obj:get_luaentity()._piercing = 1 * enchantments.piercing + else + obj:get_luaentity()._piercing = 0 + end + end + obj:set_velocity({x=dir.x*power, y=dir.y*power, z=dir.z*power}) + obj:set_acceleration({x=0, y=-GRAVITY, z=0}) + obj:set_yaw(yaw-math.pi/2) + local le = obj:get_luaentity() + le._shooter = shooter + le._source_object = shooter + le._damage = damage + le._is_critical = is_critical + le._startpos = pos + le._knockback = knockback + le._collectable = collectable + minetest.sound_play("mcl_bows_crossbow_shoot", {pos=pos, max_hear_distance=16}, true) + if shooter and shooter:is_player() then + if obj:get_luaentity().player == "" then + obj:get_luaentity().player = shooter + end + obj:get_luaentity().node = shooter:get_inventory():get_stack("main", 1):get_name() + end + return obj +end + +local function get_arrow(player) + local inv = player:get_inventory() + local arrow_stack, arrow_stack_id + for i=1, inv:get_size("main") do + local it = inv:get_stack("main", i) + if not it:is_empty() and minetest.get_item_group(it:get_name(), "ammo_crossbow") ~= 0 then + arrow_stack = it + arrow_stack_id = i + break + end + end + return arrow_stack, arrow_stack_id +end + +local function player_shoot_arrow(itemstack, player, power, damage, is_critical) + local has_multishot_enchantment = mcl_enchanting.has_enchantment(player:get_wielded_item(), "multishot") + local arrow_itemstring = wielditem:get_meta():get("arrow") + + if not arrow_itemstring then + return false + end + + local playerpos = player:get_pos() + local dir = player:get_look_dir() + local yaw = player:get_look_horizontal() + + if has_multishot_enchantment then + mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, {x=dir.x, y=dir.y, z=dir.z + .2}, yaw, player, power, damage, is_critical, player:get_wielded_item(), false) + mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, {x=dir.x, y=dir.y, z=dir.z - .2}, yaw, player, power, damage, is_critical, player:get_wielded_item(), false) + mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical, player:get_wielded_item(), true) + else + mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical, player:get_wielded_item(), true) + end + return true +end + +-- Bow item, uncharged state +minetest.register_tool("mcl_bows:crossbow", { + description = S("Corssbow"), + _tt_help = S("Launches arrows"), + _doc_items_longdesc = S("Bows are ranged weapons to shoot arrows at your foes.").."\n".. +S("The speed and damage of the arrow increases the longer you charge. The regular damage of the arrow is between 1 and 9. At full charge, there's also a 20% of a critical hit, dealing 10 damage instead."), + _doc_items_usagehelp = S("To use the bow, you first need to have at least one arrow anywhere in your inventory (unless in Creative Mode). Hold down the right mouse button to charge, release to shoot."), + _doc_items_durability = BOW_DURABILITY, + inventory_image = "mcl_bows_crossbow.png", + wield_scale = mcl_vars.tool_wield_scale, + stack_max = 1, + range = 4, + -- Trick to disable digging as well + on_use = function() return end, + on_place = function(itemstack, player, pointed_thing) + if pointed_thing and pointed_thing.type == "node" then + -- Call on_rightclick if the pointed node defines it + local node = minetest.get_node(pointed_thing.under) + if player and not player:get_player_control().sneak then + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then + return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, player, itemstack) or itemstack + end + end + end + + itemstack:get_meta():set_string("active", "true") + return itemstack + end, + on_secondary_use = function(itemstack) + itemstack:get_meta():set_string("active", "true") + return itemstack + end, + groups = {weapon=1,weapon_ranged=1,crossbow=1,enchantability=1}, + _mcl_uses = 326, +}) + +minetest.register_tool("mcl_bows:crossbow_loaded", { + description = S("Corssbow"), + _tt_help = S("Launches arrows"), + _doc_items_longdesc = S("Corssbow are ranged weapons to shoot arrows at your foes.").."\n".. +S("The speed and damage of the arrow increases the longer you charge. The regular damage of the arrow is between 1 and 9. At full charge, there's also a 20% of a critical hit, dealing 10 damage instead."), + _doc_items_usagehelp = S("To use the corssbow, you first need to have at least one arrow anywhere in your inventory (unless in Creative Mode). Hold down the right mouse button to charge, release to load an arrow into the chamber, then to shoot press left mouse."), + _doc_items_durability = BOW_DURABILITY, + inventory_image = "mcl_bows_crossbow_3.png", + wield_scale = mcl_vars.tool_wield_scale, + stack_max = 1, + range = 4, + -- Trick to disable digging as well + on_use = function() return end, + on_place = function(itemstack, player, pointed_thing) + if pointed_thing and pointed_thing.type == "node" then + -- Call on_rightclick if the pointed node defines it + local node = minetest.get_node(pointed_thing.under) + if player and not player:get_player_control().sneak then + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then + return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, player, itemstack) or itemstack + end + end + end + + itemstack:get_meta():set_string("active", "true") + return itemstack + end, + on_secondary_use = function(itemstack) + itemstack:get_meta():set_string("active", "true") + return itemstack + end, + groups = {weapon=1,weapon_ranged=1,crossbow=1,enchantability=1}, + _mcl_uses = 326, +}) + +-- Iterates through player inventory and resets all the bows in "charging" state back to their original stage +local function reset_bows(player) + local inv = player:get_inventory() + local list = inv:get_list("main") + for place, stack in pairs(list) do + if stack:get_name() == "mcl_bows:crossbow" or stack:get_name() == "mcl_bows:crossbow_enchanted" then + stack:get_meta():set_string("active", "") + elseif stack:get_name()=="mcl_bows:crossbow_0" or stack:get_name()=="mcl_bows:crossbow_1" or stack:get_name()=="mcl_bows:crossbow_2" then + stack:set_name("mcl_bows:crossbow") + stack:get_meta():set_string("active", "") + list[place] = stack + elseif stack:get_name()=="mcl_bows:crossbow_0_enchanted" or stack:get_name()=="mcl_bows:crossbow_1_enchanted" or stack:get_name()=="mcl_bows:crossbow_2_enchanted" then + stack:set_name("mcl_bows:crossbow_enchanted") + stack:get_meta():set_string("active", "") + list[place] = stack + end + end + inv:set_list("main", list) +end + +-- Resets the bow charging state and player speed. To be used when the player is no longer charging the bow +local function reset_bow_state(player, also_reset_bows) + bow_load[player:get_player_name()] = nil + bow_index[player:get_player_name()] = nil + if minetest.get_modpath("playerphysics") then + playerphysics.remove_physics_factor(player, "speed", "mcl_bows:use_crossbow") + end + if also_reset_bows then + reset_bows(player) + end +end + +-- Bow in charging state +for level=0, 2 do + minetest.register_tool("mcl_bows:crossbow_"..level, { + description = S("Crossbow"), + _doc_items_create_entry = false, + inventory_image = "mcl_bows_crossbow_"..level..".png", + wield_scale = mcl_vars.tool_wield_scale, + stack_max = 1, + range = 0, -- Pointing range to 0 to prevent punching with bow :D + groups = {not_in_creative_inventory=1, not_in_craft_guide=1, bow=1, enchantability=1}, + -- Trick to disable digging as well + on_use = function() return end, + on_drop = function(itemstack, dropper, pos) + reset_bow_state(dropper) + itemstack:get_meta():set_string("active", "") + if mcl_enchanting.is_enchanted(itemstack:get_name()) then + itemstack:set_name("mcl_bows:crossbow_enchanted") + else + itemstack:set_name("mcl_bows:crossbow") + end + minetest.item_drop(itemstack, dropper, pos) + itemstack:take_item() + return itemstack + end, + -- Prevent accidental interaction with itemframes and other nodes + on_place = function(itemstack) + return itemstack + end, + _mcl_uses = 385, + }) +end + + +controls.register_on_release(function(player, key, time) + if key~="RMB" then return end + --local inv = minetest.get_inventory({type="player", name=player:get_player_name()}) + local wielditem = player:get_wielded_item() + if wielditem:get_name()=="mcl_bows:crossbow_2" and get_arrow(player) or wielditem:get_name()=="mcl_bows:crossbow_2" and minetest.is_creative_enabled(player:get_player_name()) or wielditem:get_name()=="mcl_bows:crossbow_2_enchanted" and get_arrow(player) or wielditem:get_name()=="mcl_bows:crossbow_2_enchanted" and minetest.is_creative_enabled(player:get_player_name()) then + local arrow_stack, arrow_stack_id = get_arrow(player) + local arrow_itemstring + + if minetest.is_creative_enabled(player:get_player_name()) then + if arrow_stack then + arrow_itemstring = arrow_stack:get_name() + else + arrow_itemstring = "mcl_bows:arrow" + end + else + arrow_itemstring = arrow_stack:get_name() + arrow_stack:take_item() + player:get_inventory():set_stack("main", arrow_stack_id, arrow_stack) + end + + wielditem:get_meta():set_string("arrow", arrow_itemstring) + + if wielditem:get_name()=="mcl_bows:crossbow_2" then + wielditem:set_name("mcl_bows:crossbow_loaded") + else + wielditem:set_name("mcl_bows:crossbow_loaded_enchanted") + end + player:set_wielded_item(wielditem) + minetest.sound_play("mcl_bows_crossbow_load", {pos=player:get_pos(), max_hear_distance=16}, true) + else + reset_bow_state(player, true) + end +end) + +controls.register_on_press(function(player, key, time) + if key~="LMB" then return end + wielditem = player:get_wielded_item() + if wielditem:get_name()=="mcl_bows:crossbow_loaded" or wielditem:get_name()=="mcl_bows:crossbow_loaded_enchanted" then + local enchanted = mcl_enchanting.is_enchanted(wielditem:get_name()) + local speed, damage + local p_load = bow_load[player:get_player_name()] + local charge + -- Type sanity check + if type(p_load) == "number" then + charge = minetest.get_us_time() - p_load + else + -- In case something goes wrong ... + -- Just assume minimum charge. + charge = 0 + minetest.log("warning", "[mcl_bows] Player "..player:get_player_name().." fires arrow with non-numeric bow_load!") + end + charge = math.max(math.min(charge, BOW_CHARGE_TIME_FULL), 0) + + local charge_ratio = charge / BOW_CHARGE_TIME_FULL + charge_ratio = math.max(math.min(charge_ratio, 1), 0) + + -- Calculate damage and speed + -- Fully charged + local is_critical = false + speed = BOW_MAX_SPEED + local r = math.random(1,5) + if r == 1 then + -- 20% chance for critical hit + damage = 10 + is_critical = true + else + damage = 9 + end + + local has_shot = player_shoot_arrow(wielditem, player, speed, damage, is_critical) + + if enchanted then + wielditem:set_name("mcl_bows:crossbow_enchanted") + else + wielditem:set_name("mcl_bows:crossbow") + end + + if has_shot and not minetest.is_creative_enabled(player:get_player_name()) then + local durability = BOW_DURABILITY + local unbreaking = mcl_enchanting.get_enchantment(wielditem, "unbreaking") + local multishot = mcl_enchanting.get_enchantment(wielditem, "multishot") + if unbreaking > 0 then + durability = durability * (unbreaking + 1) + end + if multishot then + durability = durability / 3 + end + wielditem:add_wear(65535/durability) + end + player:set_wielded_item(wielditem) + reset_bow_state(player, true) + end +end) + +controls.register_on_hold(function(player, key, time) + local name = player:get_player_name() + local creative = minetest.is_creative_enabled(name) + if key ~= "RMB" then + return + end + --local inv = minetest.get_inventory({type="player", name=name}) + local wielditem = player:get_wielded_item() + local enchantments = mcl_enchanting.get_enchantments(wielditem) + if enchantments.quick_charge then + BOW_CHARGE_TIME_HALF = _BOW_CHARGE_TIME_HALF - (enchantments.quick_charge * 0.13 * 1000000 * .5) + BOW_CHARGE_TIME_FULL = _BOW_CHARGE_TIME_FULL - (enchantments.quick_charge * 0.13 * 1000000) + else + BOW_CHARGE_TIME_HALF = _BOW_CHARGE_TIME_HALF + BOW_CHARGE_TIME_FULL = _BOW_CHARGE_TIME_FULL + end + + if bow_load[name] == nil and (wielditem:get_name()=="mcl_bows:crossbow" or wielditem:get_name()=="mcl_bows:crossbow_enchanted") and wielditem:get_meta():get("active") and (creative or get_arrow(player)) then + local enchanted = mcl_enchanting.is_enchanted(wielditem:get_name()) + if enchanted then + wielditem:set_name("mcl_bows:crossbow_0_enchanted") + play_load_sound(0, player:get_pos()) + else + wielditem:set_name("mcl_bows:crossbow_0") + play_load_sound(0, player:get_pos()) + end + player:set_wielded_item(wielditem) + if minetest.get_modpath("playerphysics") then + -- Slow player down when using bow + playerphysics.add_physics_factor(player, "speed", "mcl_bows:use_crossbow", PLAYER_USE_CROSSBOW_SPEED) + end + bow_load[name] = minetest.get_us_time() + bow_index[name] = player:get_wield_index() + else + if player:get_wield_index() == bow_index[name] then + if type(bow_load[name]) == "number" then + if wielditem:get_name() == "mcl_bows:crossbow_0" and minetest.get_us_time() - bow_load[name] >= BOW_CHARGE_TIME_HALF then + wielditem:set_name("mcl_bows:crossbow_1") + play_load_sound(1, player:get_pos()) + elseif wielditem:get_name() == "mcl_bows:crossbow_0_enchanted" and minetest.get_us_time() - bow_load[name] >= BOW_CHARGE_TIME_HALF then + wielditem:set_name("mcl_bows:crossbow_1_enchanted") + play_load_sound(1, player:get_pos()) + elseif wielditem:get_name() == "mcl_bows:crossbow_1" and minetest.get_us_time() - bow_load[name] >= BOW_CHARGE_TIME_FULL then + wielditem:set_name("mcl_bows:crossbow_2") + play_load_sound(2, player:get_pos()) + elseif wielditem:get_name() == "mcl_bows:crossbow_1_enchanted" and minetest.get_us_time() - bow_load[name] >= BOW_CHARGE_TIME_FULL then + wielditem:set_name("mcl_bows:crossbow_2_enchanted") + play_load_sound(2, player:get_pos()) + end + else + if wielditem:get_name() == "mcl_bows:crossbow_0" or wielditem:get_name() == "mcl_bows:crossbow_1" or wielditem:get_name() == "mcl_bows:crossbow_2" then + wielditem:set_name("mcl_bows:crossbow") + play_load_sound(1, player:get_pos()) + elseif wielditem:get_name() == "mcl_bows:crossbow_0_enchanted" or wielditem:get_name() == "mcl_bows:crossbow_1_enchanted" or wielditem:get_name() == "mcl_bows:crossbow_2_enchanted" then + wielditem:set_name("mcl_bows:crossbow_enchanted") + play_load_sound(1, player:get_pos()) + end + end + player:set_wielded_item(wielditem) + else + reset_bow_state(player, true) + end + end +end) + +minetest.register_globalstep(function(dtime) + for _, player in pairs(minetest.get_connected_players()) do + local name = player:get_player_name() + local wielditem = player:get_wielded_item() + local wieldindex = player:get_wield_index() + --local controls = player:get_player_control() + if type(bow_load[name]) == "number" and ((wielditem:get_name()~="mcl_bows:crossbow_0" and wielditem:get_name()~="mcl_bows:crossbow_1" and wielditem:get_name()~="mcl_bows:crossbow_2" and wielditem:get_name()~="mcl_bows:crossbow_0_enchanted" and wielditem:get_name()~="mcl_bows:crossbow_1_enchanted" and wielditem:get_name()~="mcl_bows:crossbow_2_enchanted") or wieldindex ~= bow_index[name]) then + reset_bow_state(player, true) + end + end +end) + +minetest.register_on_joinplayer(function(player) + reset_bows(player) +end) + +minetest.register_on_leaveplayer(function(player) + reset_bow_state(player, true) +end) + +if minetest.get_modpath("mcl_core") and minetest.get_modpath("mcl_mobitems") then + minetest.register_craft({ + output = "mcl_bows:crossbow", + recipe = { + {"mcl_core:stick", "mcl_core:iron_ingot", "mcl_core:stick"}, + {"mcl_mobitems:string", "mcl_bows:arrow", "mcl_mobitems:string"}, + {"", "mcl_core:stick", ""}, + } + }) +end + +minetest.register_craft({ + type = "fuel", + recipe = "group:bow", + burntime = 15, +}) + +-- Add entry aliases for the Help +if minetest.get_modpath("doc") then + doc.add_entry_alias("tools", "mcl_bows:crossbow", "tools", "mcl_bows:crossbow_0") + doc.add_entry_alias("tools", "mcl_bows:crossbow", "tools", "mcl_bows:crossbow_1") + doc.add_entry_alias("tools", "mcl_bows:crossbow", "tools", "mcl_bows:crossbow_2") +end diff --git a/mods/ITEMS/mcl_bows/init.lua b/mods/ITEMS/mcl_bows/init.lua index a2745d9508..d5b06dac7c 100644 --- a/mods/ITEMS/mcl_bows/init.lua +++ b/mods/ITEMS/mcl_bows/init.lua @@ -1,5 +1,11 @@ +--Bow dofile(minetest.get_modpath("mcl_bows") .. "/arrow.lua") dofile(minetest.get_modpath("mcl_bows") .. "/bow.lua") +dofile(minetest.get_modpath("mcl_bows") .. "/rocket.lua") +--Crossbow +dofile(minetest.get_modpath("mcl_bows") .. "/crossbow.lua") + +--Compatiblility with older MineClone worlds minetest.register_alias("mcl_throwing:bow", "mcl_bows:bow") minetest.register_alias("mcl_throwing:arrow", "mcl_bows:arrow") diff --git a/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.b3d b/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.b3d new file mode 100644 index 0000000000..0a34f1eaa6 Binary files /dev/null and b/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.b3d differ diff --git a/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.mtl b/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.mtl new file mode 100644 index 0000000000..f231bdf4c1 --- /dev/null +++ b/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.obj b/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.obj new file mode 100644 index 0000000000..e2bd11d347 --- /dev/null +++ b/mods/ITEMS/mcl_bows/models/mcl_bows_rocket.obj @@ -0,0 +1,1016 @@ +# Blender v3.0.0 Alpha OBJ File: '' +# www.blender.org +mtllib mcl_bows_rocket.mtl +o Plane +v -1.414214 -0.063116 0.000000 +v 0.000000 -0.063116 1.414214 +v -0.000000 -0.063116 -1.414214 +v 1.414214 -0.063116 -0.000000 +v -1.414214 -0.062205 0.000000 +v 0.000000 -0.062205 1.414214 +v -0.000000 -0.062205 -1.414214 +v 1.414214 -0.062205 -0.000000 +v -1.414214 -0.060838 0.000000 +v 0.000000 -0.060838 1.414214 +v -0.000000 -0.060838 -1.414214 +v 1.414214 -0.060838 -0.000000 +v -1.414214 -0.059926 0.000000 +v 0.000000 -0.059926 1.414214 +v -0.000000 -0.059926 -1.414214 +v 1.414214 -0.059926 -0.000000 +v -1.414214 -0.058559 0.000000 +v 0.000000 -0.058559 1.414214 +v -0.000000 -0.058559 -1.414214 +v 1.414214 -0.058559 -0.000000 +v -1.414214 -0.057648 0.000000 +v 0.000000 -0.057648 1.414214 +v -0.000000 -0.057648 -1.414214 +v 1.414214 -0.057648 -0.000000 +v -1.414214 -0.056281 0.000000 +v 0.000000 -0.056281 1.414214 +v -0.000000 -0.056281 -1.414214 +v 1.414214 -0.056281 -0.000000 +v -1.414214 -0.055369 0.000000 +v 0.000000 -0.055369 1.414214 +v -0.000000 -0.055369 -1.414214 +v 1.414214 -0.055369 -0.000000 +v -1.414214 -0.054002 0.000000 +v 0.000000 -0.054002 1.414214 +v -0.000000 -0.054002 -1.414214 +v 1.414214 -0.054002 -0.000000 +v -1.414214 -0.053091 0.000000 +v 0.000000 -0.053091 1.414214 +v -0.000000 -0.053091 -1.414214 +v 1.414214 -0.053091 -0.000000 +v -1.414214 -0.051723 0.000000 +v 0.000000 -0.051723 1.414214 +v -0.000000 -0.051723 -1.414214 +v 1.414214 -0.051723 -0.000000 +v -1.414214 -0.050812 0.000000 +v 0.000000 -0.050812 1.414214 +v -0.000000 -0.050812 -1.414214 +v 1.414214 -0.050812 -0.000000 +v -1.414214 -0.049445 0.000000 +v 0.000000 -0.049445 1.414214 +v -0.000000 -0.049445 -1.414214 +v 1.414214 -0.049445 -0.000000 +v -1.414214 -0.048533 0.000000 +v 0.000000 -0.048533 1.414214 +v -0.000000 -0.048533 -1.414214 +v 1.414214 -0.048533 -0.000000 +v -1.414214 -0.047166 0.000000 +v 0.000000 -0.047166 1.414214 +v -0.000000 -0.047166 -1.414214 +v 1.414214 -0.047166 -0.000000 +v -1.414214 -0.046255 0.000000 +v 0.000000 -0.046255 1.414214 +v -0.000000 -0.046255 -1.414214 +v 1.414214 -0.046255 -0.000000 +v -1.414214 -0.044888 0.000000 +v 0.000000 -0.044888 1.414214 +v -0.000000 -0.044888 -1.414214 +v 1.414214 -0.044888 -0.000000 +v -1.414214 -0.043976 0.000000 +v 0.000000 -0.043976 1.414214 +v -0.000000 -0.043976 -1.414214 +v 1.414214 -0.043976 -0.000000 +v -1.414214 -0.042609 0.000000 +v 0.000000 -0.042609 1.414214 +v -0.000000 -0.042609 -1.414214 +v 1.414214 -0.042609 -0.000000 +v -1.414214 -0.041698 0.000000 +v 0.000000 -0.041698 1.414214 +v -0.000000 -0.041698 -1.414214 +v 1.414214 -0.041698 -0.000000 +v -1.414214 -0.040331 0.000000 +v 0.000000 -0.040331 1.414214 +v -0.000000 -0.040331 -1.414214 +v 1.414214 -0.040331 -0.000000 +v -1.414214 -0.039419 0.000000 +v 0.000000 -0.039419 1.414214 +v -0.000000 -0.039419 -1.414214 +v 1.414214 -0.039419 -0.000000 +v -1.414214 -0.038052 0.000000 +v 0.000000 -0.038052 1.414214 +v -0.000000 -0.038052 -1.414214 +v 1.414214 -0.038052 -0.000000 +v -1.414214 -0.037141 0.000000 +v 0.000000 -0.037141 1.414214 +v -0.000000 -0.037141 -1.414214 +v 1.414214 -0.037141 -0.000000 +v -1.414214 -0.035773 0.000000 +v 0.000000 -0.035773 1.414214 +v -0.000000 -0.035773 -1.414214 +v 1.414214 -0.035773 -0.000000 +v -1.414214 -0.034862 0.000000 +v 0.000000 -0.034862 1.414214 +v -0.000000 -0.034862 -1.414214 +v 1.414214 -0.034862 -0.000000 +v -1.414214 -0.033495 0.000000 +v 0.000000 -0.033495 1.414214 +v -0.000000 -0.033495 -1.414214 +v 1.414214 -0.033495 -0.000000 +v -1.414214 -0.032583 0.000000 +v 0.000000 -0.032583 1.414214 +v -0.000000 -0.032583 -1.414214 +v 1.414214 -0.032583 -0.000000 +v -1.414214 -0.031216 0.000000 +v 0.000000 -0.031216 1.414214 +v -0.000000 -0.031216 -1.414214 +v 1.414214 -0.031216 -0.000000 +v -1.414214 -0.030305 0.000000 +v 0.000000 -0.030305 1.414214 +v -0.000000 -0.030305 -1.414214 +v 1.414214 -0.030305 -0.000000 +v -1.414214 -0.028938 0.000000 +v 0.000000 -0.028938 1.414214 +v -0.000000 -0.028938 -1.414214 +v 1.414214 -0.028938 -0.000000 +v -1.414214 -0.028026 0.000000 +v 0.000000 -0.028026 1.414214 +v -0.000000 -0.028026 -1.414214 +v 1.414214 -0.028026 -0.000000 +v -1.414214 -0.026659 0.000000 +v 0.000000 -0.026659 1.414214 +v -0.000000 -0.026659 -1.414214 +v 1.414214 -0.026659 -0.000000 +v -1.414214 -0.025748 0.000000 +v 0.000000 -0.025748 1.414214 +v -0.000000 -0.025748 -1.414214 +v 1.414214 -0.025748 -0.000000 +v -1.414214 -0.024381 0.000000 +v 0.000000 -0.024381 1.414214 +v -0.000000 -0.024381 -1.414214 +v 1.414214 -0.024381 -0.000000 +v -1.414214 -0.023469 0.000000 +v 0.000000 -0.023469 1.414214 +v -0.000000 -0.023469 -1.414214 +v 1.414214 -0.023469 -0.000000 +v -1.414214 -0.022102 0.000000 +v 0.000000 -0.022102 1.414214 +v -0.000000 -0.022102 -1.414214 +v 1.414214 -0.022102 -0.000000 +v -1.414214 -0.021191 0.000000 +v 0.000000 -0.021191 1.414214 +v -0.000000 -0.021191 -1.414214 +v 1.414214 -0.021191 -0.000000 +v -1.414214 -0.019824 0.000000 +v 0.000000 -0.019824 1.414214 +v -0.000000 -0.019824 -1.414214 +v 1.414214 -0.019824 -0.000000 +v -1.414214 -0.018912 0.000000 +v 0.000000 -0.018912 1.414214 +v -0.000000 -0.018912 -1.414214 +v 1.414214 -0.018912 -0.000000 +v -1.414214 -0.017545 0.000000 +v 0.000000 -0.017545 1.414214 +v -0.000000 -0.017545 -1.414214 +v 1.414214 -0.017545 -0.000000 +v -1.414214 -0.016634 0.000000 +v 0.000000 -0.016634 1.414214 +v -0.000000 -0.016634 -1.414214 +v 1.414214 -0.016634 -0.000000 +v -1.414214 -0.015266 0.000000 +v 0.000000 -0.015266 1.414214 +v -0.000000 -0.015266 -1.414214 +v 1.414214 -0.015266 -0.000000 +v -1.414214 -0.014355 0.000000 +v 0.000000 -0.014355 1.414214 +v -0.000000 -0.014355 -1.414214 +v 1.414214 -0.014355 -0.000000 +v -1.414214 -0.012988 0.000000 +v 0.000000 -0.012988 1.414214 +v -0.000000 -0.012988 -1.414214 +v 1.414214 -0.012988 -0.000000 +v -1.414214 -0.012076 0.000000 +v 0.000000 -0.012076 1.414214 +v -0.000000 -0.012076 -1.414214 +v 1.414214 -0.012076 -0.000000 +v -1.414214 -0.010709 0.000000 +v 0.000000 -0.010709 1.414214 +v -0.000000 -0.010709 -1.414214 +v 1.414214 -0.010709 -0.000000 +v -1.414214 -0.009798 0.000000 +v 0.000000 -0.009798 1.414214 +v -0.000000 -0.009798 -1.414214 +v 1.414214 -0.009798 -0.000000 +v -1.414214 -0.008431 0.000000 +v 0.000000 -0.008431 1.414214 +v -0.000000 -0.008431 -1.414214 +v 1.414214 -0.008431 -0.000000 +v -1.414214 -0.007519 0.000000 +v 0.000000 -0.007519 1.414214 +v -0.000000 -0.007519 -1.414214 +v 1.414214 -0.007519 -0.000000 +v -1.414214 -0.006152 0.000000 +v 0.000000 -0.006152 1.414214 +v -0.000000 -0.006152 -1.414214 +v 1.414214 -0.006152 -0.000000 +v -1.414214 -0.005241 0.000000 +v 0.000000 -0.005241 1.414214 +v -0.000000 -0.005241 -1.414214 +v 1.414214 -0.005241 -0.000000 +v -1.414214 -0.003874 0.000000 +v 0.000000 -0.003874 1.414214 +v -0.000000 -0.003874 -1.414214 +v 1.414214 -0.003874 -0.000000 +v -1.414214 -0.002962 0.000000 +v 0.000000 -0.002962 1.414214 +v -0.000000 -0.002962 -1.414214 +v 1.414214 -0.002962 -0.000000 +v -1.414214 -0.001595 0.000000 +v 0.000000 -0.001595 1.414214 +v -0.000000 -0.001595 -1.414214 +v 1.414214 -0.001595 -0.000000 +v -1.414214 -0.000684 0.000000 +v 0.000000 -0.000684 1.414214 +v -0.000000 -0.000684 -1.414214 +v 1.414214 -0.000684 -0.000000 +v -1.414214 0.000684 0.000000 +v 0.000000 0.000684 1.414214 +v -0.000000 0.000684 -1.414214 +v 1.414214 0.000684 -0.000000 +v -1.414214 0.001595 0.000000 +v 0.000000 0.001595 1.414214 +v -0.000000 0.001595 -1.414214 +v 1.414214 0.001595 -0.000000 +v -1.414214 0.002962 0.000000 +v 0.000000 0.002962 1.414214 +v -0.000000 0.002962 -1.414214 +v 1.414214 0.002962 -0.000000 +v -1.414214 0.003874 0.000000 +v 0.000000 0.003874 1.414214 +v -0.000000 0.003874 -1.414214 +v 1.414214 0.003874 -0.000000 +v -1.414214 0.005241 0.000000 +v 0.000000 0.005241 1.414214 +v -0.000000 0.005241 -1.414214 +v 1.414214 0.005241 -0.000000 +v -1.414214 0.006152 0.000000 +v 0.000000 0.006152 1.414214 +v -0.000000 0.006152 -1.414214 +v 1.414214 0.006152 -0.000000 +v -1.414214 0.007519 0.000000 +v 0.000000 0.007519 1.414214 +v -0.000000 0.007519 -1.414214 +v 1.414214 0.007519 -0.000000 +v -1.414214 0.008431 0.000000 +v 0.000000 0.008431 1.414214 +v -0.000000 0.008431 -1.414214 +v 1.414214 0.008431 -0.000000 +v -1.414214 0.009798 0.000000 +v 0.000000 0.009798 1.414214 +v -0.000000 0.009798 -1.414214 +v 1.414214 0.009798 -0.000000 +v -1.414214 0.010709 0.000000 +v 0.000000 0.010709 1.414214 +v -0.000000 0.010709 -1.414214 +v 1.414214 0.010709 -0.000000 +v -1.414214 0.012076 0.000000 +v 0.000000 0.012076 1.414214 +v -0.000000 0.012076 -1.414214 +v 1.414214 0.012076 -0.000000 +v -1.414214 0.012988 0.000000 +v 0.000000 0.012988 1.414214 +v -0.000000 0.012988 -1.414214 +v 1.414214 0.012988 -0.000000 +v -1.414214 0.014355 0.000000 +v 0.000000 0.014355 1.414214 +v -0.000000 0.014355 -1.414214 +v 1.414214 0.014355 -0.000000 +v -1.414214 0.015266 0.000000 +v 0.000000 0.015266 1.414214 +v -0.000000 0.015266 -1.414214 +v 1.414214 0.015266 -0.000000 +v -1.414214 0.016634 0.000000 +v 0.000000 0.016634 1.414214 +v -0.000000 0.016634 -1.414214 +v 1.414214 0.016634 -0.000000 +v -1.414214 0.017545 0.000000 +v 0.000000 0.017545 1.414214 +v -0.000000 0.017545 -1.414214 +v 1.414214 0.017545 -0.000000 +v -1.414214 0.018912 0.000000 +v 0.000000 0.018912 1.414214 +v -0.000000 0.018912 -1.414214 +v 1.414214 0.018912 -0.000000 +v -1.414214 0.019824 0.000000 +v 0.000000 0.019824 1.414214 +v -0.000000 0.019824 -1.414214 +v 1.414214 0.019824 -0.000000 +v -1.414214 0.021191 0.000000 +v 0.000000 0.021191 1.414214 +v -0.000000 0.021191 -1.414214 +v 1.414214 0.021191 -0.000000 +v -1.414214 0.022102 0.000000 +v 0.000000 0.022102 1.414214 +v -0.000000 0.022102 -1.414214 +v 1.414214 0.022102 -0.000000 +v -1.414214 0.023469 0.000000 +v 0.000000 0.023469 1.414214 +v -0.000000 0.023469 -1.414214 +v 1.414214 0.023469 -0.000000 +v -1.414214 0.024381 0.000000 +v 0.000000 0.024381 1.414214 +v -0.000000 0.024381 -1.414214 +v 1.414214 0.024381 -0.000000 +v -1.414214 0.025748 0.000000 +v 0.000000 0.025748 1.414214 +v -0.000000 0.025748 -1.414214 +v 1.414214 0.025748 -0.000000 +v -1.414214 0.026659 0.000000 +v 0.000000 0.026659 1.414214 +v -0.000000 0.026659 -1.414214 +v 1.414214 0.026659 -0.000000 +v -1.414214 0.028026 0.000000 +v 0.000000 0.028026 1.414214 +v -0.000000 0.028026 -1.414214 +v 1.414214 0.028026 -0.000000 +v -1.414214 0.028938 0.000000 +v 0.000000 0.028938 1.414214 +v -0.000000 0.028938 -1.414214 +v 1.414214 0.028938 -0.000000 +v -1.414214 0.030305 0.000000 +v 0.000000 0.030305 1.414214 +v -0.000000 0.030305 -1.414214 +v 1.414214 0.030305 -0.000000 +v -1.414214 0.031216 0.000000 +v 0.000000 0.031216 1.414214 +v -0.000000 0.031216 -1.414214 +v 1.414214 0.031216 -0.000000 +v -1.414214 0.032584 0.000000 +v 0.000000 0.032584 1.414214 +v -0.000000 0.032584 -1.414214 +v 1.414214 0.032584 -0.000000 +v -1.414214 0.033495 0.000000 +v 0.000000 0.033495 1.414214 +v -0.000000 0.033495 -1.414214 +v 1.414214 0.033495 -0.000000 +v -1.414214 0.034862 0.000000 +v 0.000000 0.034862 1.414214 +v -0.000000 0.034862 -1.414214 +v 1.414214 0.034862 -0.000000 +v -1.414214 0.035774 0.000000 +v 0.000000 0.035774 1.414214 +v -0.000000 0.035774 -1.414214 +v 1.414214 0.035774 -0.000000 +v -1.414214 0.037141 0.000000 +v 0.000000 0.037141 1.414214 +v -0.000000 0.037141 -1.414214 +v 1.414214 0.037141 -0.000000 +v -1.414214 0.038052 0.000000 +v 0.000000 0.038052 1.414214 +v -0.000000 0.038052 -1.414214 +v 1.414214 0.038052 -0.000000 +v -1.414214 0.039419 0.000000 +v 0.000000 0.039419 1.414214 +v -0.000000 0.039419 -1.414214 +v 1.414214 0.039419 -0.000000 +v -1.414214 0.040331 0.000000 +v 0.000000 0.040331 1.414214 +v -0.000000 0.040331 -1.414214 +v 1.414214 0.040331 -0.000000 +v -1.414214 0.041698 0.000000 +v 0.000000 0.041698 1.414214 +v -0.000000 0.041698 -1.414214 +v 1.414214 0.041698 -0.000000 +v -1.414214 0.042609 0.000000 +v 0.000000 0.042609 1.414214 +v -0.000000 0.042609 -1.414214 +v 1.414214 0.042609 -0.000000 +v -1.414214 0.043976 0.000000 +v 0.000000 0.043976 1.414214 +v -0.000000 0.043976 -1.414214 +v 1.414214 0.043976 -0.000000 +v -1.414214 0.044888 0.000000 +v 0.000000 0.044888 1.414214 +v -0.000000 0.044888 -1.414214 +v 1.414214 0.044888 -0.000000 +v -1.414214 0.046255 0.000000 +v 0.000000 0.046255 1.414214 +v -0.000000 0.046255 -1.414214 +v 1.414214 0.046255 -0.000000 +v -1.414214 0.047166 0.000000 +v 0.000000 0.047166 1.414214 +v -0.000000 0.047166 -1.414214 +v 1.414214 0.047166 -0.000000 +v -1.414214 0.048533 0.000000 +v 0.000000 0.048533 1.414214 +v -0.000000 0.048533 -1.414214 +v 1.414214 0.048533 -0.000000 +v -1.414214 0.049445 0.000000 +v 0.000000 0.049445 1.414214 +v -0.000000 0.049445 -1.414214 +v 1.414214 0.049445 -0.000000 +v -1.414214 0.050812 0.000000 +v 0.000000 0.050812 1.414214 +v -0.000000 0.050812 -1.414214 +v 1.414214 0.050812 -0.000000 +v -1.414214 0.051723 0.000000 +v 0.000000 0.051723 1.414214 +v -0.000000 0.051723 -1.414214 +v 1.414214 0.051723 -0.000000 +v -1.414214 0.053091 0.000000 +v 0.000000 0.053091 1.414214 +v -0.000000 0.053091 -1.414214 +v 1.414214 0.053091 -0.000000 +v -1.414214 0.054002 0.000000 +v 0.000000 0.054002 1.414214 +v -0.000000 0.054002 -1.414214 +v 1.414214 0.054002 -0.000000 +v -1.414214 0.055369 0.000000 +v 0.000000 0.055369 1.414214 +v -0.000000 0.055369 -1.414214 +v 1.414214 0.055369 -0.000000 +v -1.414214 0.056281 0.000000 +v 0.000000 0.056281 1.414214 +v -0.000000 0.056281 -1.414214 +v 1.414214 0.056281 -0.000000 +v -1.414214 0.057648 0.000000 +v 0.000000 0.057648 1.414214 +v -0.000000 0.057648 -1.414214 +v 1.414214 0.057648 -0.000000 +v -1.414214 0.058559 0.000000 +v 0.000000 0.058559 1.414214 +v -0.000000 0.058559 -1.414214 +v 1.414214 0.058559 -0.000000 +v -1.414214 0.059926 0.000000 +v 0.000000 0.059926 1.414214 +v -0.000000 0.059926 -1.414214 +v 1.414214 0.059926 -0.000000 +v -1.414214 0.060838 0.000000 +v 0.000000 0.060838 1.414214 +v -0.000000 0.060838 -1.414214 +v 1.414214 0.060838 -0.000000 +v -1.414214 0.062205 0.000000 +v 0.000000 0.062205 1.414214 +v -0.000000 0.062205 -1.414214 +v 1.414214 0.062205 -0.000000 +v -1.414214 0.063116 0.000000 +v 0.000000 0.063116 1.414214 +v -0.000000 0.063116 -1.414214 +v 1.414214 0.063116 -0.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +usemtl None +s off +f 1/1/1 3/2/1 4/3/1 2/4/1 +f 5/5/2 6/6/2 8/7/2 7/8/2 +f 9/9/1 11/10/1 12/11/1 10/12/1 +f 13/13/2 14/14/2 16/15/2 15/16/2 +f 17/17/1 19/18/1 20/19/1 18/20/1 +f 21/21/2 22/22/2 24/23/2 23/24/2 +f 25/25/1 27/26/1 28/27/1 26/28/1 +f 29/29/2 30/30/2 32/31/2 31/32/2 +f 33/33/1 35/34/1 36/35/1 34/36/1 +f 37/37/2 38/38/2 40/39/2 39/40/2 +f 41/41/1 43/42/1 44/43/1 42/44/1 +f 45/45/2 46/46/2 48/47/2 47/48/2 +f 49/49/1 51/50/1 52/51/1 50/52/1 +f 53/53/2 54/54/2 56/55/2 55/56/2 +f 57/57/1 59/58/1 60/59/1 58/60/1 +f 61/61/2 62/62/2 64/63/2 63/64/2 +f 65/65/1 67/66/1 68/67/1 66/68/1 +f 69/69/2 70/70/2 72/71/2 71/72/2 +f 73/73/1 75/74/1 76/75/1 74/76/1 +f 77/77/2 78/78/2 80/79/2 79/80/2 +f 81/81/1 83/82/1 84/83/1 82/84/1 +f 85/85/2 86/86/2 88/87/2 87/88/2 +f 89/89/1 91/90/1 92/91/1 90/92/1 +f 93/93/2 94/94/2 96/95/2 95/96/2 +f 97/97/1 99/98/1 100/99/1 98/100/1 +f 101/101/2 102/102/2 104/103/2 103/104/2 +f 105/105/1 107/106/1 108/107/1 106/108/1 +f 109/109/2 110/110/2 112/111/2 111/112/2 +f 113/113/1 115/114/1 116/115/1 114/116/1 +f 117/117/2 118/118/2 120/119/2 119/120/2 +f 121/121/1 123/122/1 124/123/1 122/124/1 +f 125/125/2 126/126/2 128/127/2 127/128/2 +f 129/129/1 131/130/1 132/131/1 130/132/1 +f 133/133/2 134/134/2 136/135/2 135/136/2 +f 137/137/1 139/138/1 140/139/1 138/140/1 +f 141/141/2 142/142/2 144/143/2 143/144/2 +f 145/145/1 147/146/1 148/147/1 146/148/1 +f 149/149/2 150/150/2 152/151/2 151/152/2 +f 153/153/1 155/154/1 156/155/1 154/156/1 +f 157/157/2 158/158/2 160/159/2 159/160/2 +f 161/161/1 163/162/1 164/163/1 162/164/1 +f 165/165/2 166/166/2 168/167/2 167/168/2 +f 169/169/1 171/170/1 172/171/1 170/172/1 +f 173/173/2 174/174/2 176/175/2 175/176/2 +f 177/177/1 179/178/1 180/179/1 178/180/1 +f 181/181/2 182/182/2 184/183/2 183/184/2 +f 185/185/1 187/186/1 188/187/1 186/188/1 +f 189/189/2 190/190/2 192/191/2 191/192/2 +f 193/193/1 195/194/1 196/195/1 194/196/1 +f 197/197/2 198/198/2 200/199/2 199/200/2 +f 201/201/1 203/202/1 204/203/1 202/204/1 +f 205/205/2 206/206/2 208/207/2 207/208/2 +f 209/209/1 211/210/1 212/211/1 210/212/1 +f 213/213/2 214/214/2 216/215/2 215/216/2 +f 217/217/1 219/218/1 220/219/1 218/220/1 +f 221/221/2 222/222/2 224/223/2 223/224/2 +f 225/225/1 227/226/1 228/227/1 226/228/1 +f 229/229/2 230/230/2 232/231/2 231/232/2 +f 233/233/1 235/234/1 236/235/1 234/236/1 +f 237/237/2 238/238/2 240/239/2 239/240/2 +f 241/241/1 243/242/1 244/243/1 242/244/1 +f 245/245/2 246/246/2 248/247/2 247/248/2 +f 249/249/1 251/250/1 252/251/1 250/252/1 +f 253/253/2 254/254/2 256/255/2 255/256/2 +f 257/257/1 259/258/1 260/259/1 258/260/1 +f 261/261/2 262/262/2 264/263/2 263/264/2 +f 265/265/1 267/266/1 268/267/1 266/268/1 +f 269/269/2 270/270/2 272/271/2 271/272/2 +f 273/273/1 275/274/1 276/275/1 274/276/1 +f 277/277/2 278/278/2 280/279/2 279/280/2 +f 281/281/1 283/282/1 284/283/1 282/284/1 +f 285/285/2 286/286/2 288/287/2 287/288/2 +f 289/289/1 291/290/1 292/291/1 290/292/1 +f 293/293/2 294/294/2 296/295/2 295/296/2 +f 297/297/1 299/298/1 300/299/1 298/300/1 +f 301/301/2 302/302/2 304/303/2 303/304/2 +f 305/305/1 307/306/1 308/307/1 306/308/1 +f 309/309/2 310/310/2 312/311/2 311/312/2 +f 313/313/1 315/314/1 316/315/1 314/316/1 +f 317/317/2 318/318/2 320/319/2 319/320/2 +f 321/321/1 323/322/1 324/323/1 322/324/1 +f 325/325/2 326/326/2 328/327/2 327/328/2 +f 329/329/1 331/330/1 332/331/1 330/332/1 +f 333/333/2 334/334/2 336/335/2 335/336/2 +f 337/337/1 339/338/1 340/339/1 338/340/1 +f 341/341/2 342/342/2 344/343/2 343/344/2 +f 345/345/1 347/346/1 348/347/1 346/348/1 +f 349/349/2 350/350/2 352/351/2 351/352/2 +f 353/353/1 355/354/1 356/355/1 354/356/1 +f 357/357/2 358/358/2 360/359/2 359/360/2 +f 361/361/1 363/362/1 364/363/1 362/364/1 +f 365/365/2 366/366/2 368/367/2 367/368/2 +f 369/369/1 371/370/1 372/371/1 370/372/1 +f 373/373/2 374/374/2 376/375/2 375/376/2 +f 377/377/1 379/378/1 380/379/1 378/380/1 +f 381/381/2 382/382/2 384/383/2 383/384/2 +f 385/385/1 387/386/1 388/387/1 386/388/1 +f 389/389/2 390/390/2 392/391/2 391/392/2 +f 393/393/1 395/394/1 396/395/1 394/396/1 +f 397/397/2 398/398/2 400/399/2 399/400/2 +f 401/401/1 403/402/1 404/403/1 402/404/1 +f 405/405/2 406/406/2 408/407/2 407/408/2 +f 409/409/1 411/410/1 412/411/1 410/412/1 +f 413/413/2 414/414/2 416/415/2 415/416/2 +f 417/417/1 419/418/1 420/419/1 418/420/1 +f 421/421/2 422/422/2 424/423/2 423/424/2 +f 425/425/1 427/426/1 428/427/1 426/428/1 +f 429/429/2 430/430/2 432/431/2 431/432/2 +f 433/433/1 435/434/1 436/435/1 434/436/1 +f 437/437/2 438/438/2 440/439/2 439/440/2 +f 441/441/1 443/442/1 444/443/1 442/444/1 +f 445/445/2 446/446/2 448/447/2 447/448/2 diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua new file mode 100644 index 0000000000..678aba4d42 --- /dev/null +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -0,0 +1,706 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +local math = math +local vector = vector + +-- Time in seconds after which a stuck arrow is deleted +local ARROW_TIMEOUT = 1 +-- Time after which stuck arrow is rechecked for being stuck +local STUCK_RECHECK_TIME = 0.1 + +--local GRAVITY = 9.81 + +local YAW_OFFSET = -math.pi/2 + +local function dir_to_pitch(dir) + --local dir2 = vector.normalize(dir) + local xz = math.abs(dir.x) + math.abs(dir.z) + return -math.atan2(-dir.y, xz) +end + +local function random_arrow_positions(positions, placement) + if positions == "x" then + return math.random(-4, 4) + elseif positions == "y" then + return math.random(0, 10) + end + if placement == "front" and positions == "z" then + return 3 + elseif placement == "back" and positions == "z" then + return -3 + end + return 0 +end + +local function damage_explosion(self, damagemulitplier) + mcl_explosions.explode(self.object:get_pos(), 3, {}) + local objects = minetest.get_objects_inside_radius(self.object:get_pos(), 8) + for _,obj in pairs(objects) do + if obj:is_player() then + mcl_util.deal_damage(obj, damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos()), {type = "explosion"}) + elseif obj:get_luaentity()._cmi_is_mob then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos())}, + }, self.object:get_velocity()) + end + end +end + +local function particle_explosion(self) + local particle_pattern = math.random(1, 3) + local fpitch = 0 + local true_type = "" + local type = math.random(1,2) + local size = math.random(1,3) + local colors = {"red", "yellow", "blue", "green", "white"} + local this_colors = {colors[math.random(#colors)], colors[math.random(#colors)], colors[math.random(#colors)]} + + if size == 1 then + fpitch = math.random(200, 300) + elseif size == 2 then + fpitch = math.random(100, 130) + else + fpitch = math.random(60, 70) + end + + if type == 1 then + true_type = "Popper" + else + true_type = "Floof" + end + + if type == 1 then + minetest.sound_play("mcl_bows_firework", { + pos = self.object:get_pos(), + max_hear_distance = 100, + gain = 3.0, + pitch = fpitch/100 + }, true) + else + minetest.sound_play("mcl_bows_firework_soft", { + pos = self.object:get_pos(), + max_hear_distance = 100, + gain = 4.0, + pitch = fpitch/100 + }, true) + end + + if particle_pattern == 1 then + minetest.add_particlespawner({ + amount = 400 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-7 * size,-7 * size,-7 * size), + maxvel = vector.new(7 * size,7 * size,7 * size), + minexptime = .6 * size / 2, + maxexptime = .9 * size / 2, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[1]..".png", + glow = 14, + }) + minetest.add_particlespawner({ + amount = 400 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-2 * size,-2 * size,-2 * size), + maxvel = vector.new(2 * size,2 * size,2 * size), + minexptime = .6 * size / 2, + maxexptime = .9 * size / 2, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[2]..".png", + glow = 14, + }) + minetest.add_particlespawner({ + amount = 100 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-14 * size,-14 * size,-14 * size), + maxvel = vector.new(14 * size,14 * size,14 * size), + minexptime = .6 * size / 2, + maxexptime = .9 * size / 2, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[3]..".png", + glow = 14, + }) + elseif particle_pattern == 2 then + + minetest.add_particlespawner({ + amount = 240 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-5 * size,-5 * size,-5 * size), + maxvel = vector.new(5 * size,5 * size,5 * size), + minexptime = .6 * size / 2, + maxexptime = .9 * size / 2, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[1]..".png", + glow = 14, + }) + minetest.add_particlespawner({ + amount = 500 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-2 * size,-2 * size,-2 * size), + maxvel = vector.new(2 * size,2 * size,2 * size), + minexptime = .6 * size / 2, + maxexptime = .9 * size / 2, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[2]..".png", + glow = 14, + }) + minetest.add_particlespawner({ + amount = 350 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-3 * size,-3 * size,-3 * size), + maxvel = vector.new(3 * size,3 * size,3 * size), + minexptime = .6 * size / 2, + maxexptime = .9 * size / 2, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[3]..".png", + glow = 14, + }) + elseif particle_pattern == 3 then + + minetest.add_particlespawner({ + amount = 400 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-6 * size,-4 * size,-6 * size), + maxvel = vector.new(6 * size,4 * size,6 * size), + minexptime = .6 * size, + maxexptime = .9 * size, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[1]..".png", + glow = 14, + }) + minetest.add_particlespawner({ + amount = 120 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-8 * size,6 * size,-8 * size), + maxvel = vector.new(8 * size,6 * size,8 * size), + minexptime = .6 * size, + maxexptime = .9 * size, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[2]..".png", + glow = 14, + }) + minetest.add_particlespawner({ + amount = 130 * size, + time = 0.0001, + minpos = self.object:get_pos(), + maxpos = self.object:get_pos(), + minvel = vector.new(-3 * size,3 * size,-3 * size), + maxvel = vector.new(3 * size,3 * size,3 * size), + minexptime = .6 * size, + maxexptime = .9 * size, + minsize = 2 * size, + maxsize = 3 * size, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_firework_"..this_colors[3]..".png", + glow = 14, + }) + end + + return size + +end + +local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements") +local mod_button = minetest.get_modpath("mesecons_button") + +minetest.register_craftitem("mcl_bows:rocket", { + description = S("Arrow"), + _tt_help = S("Ammunition").."\n"..S("Damage from bow: 1-10").."\n"..S("Damage from dispenser: 3"), + _doc_items_longdesc = S("Arrows are ammunition for bows and dispensers.").."\n".. +S("An arrow fired from a bow has a regular damage of 1-9. At full charge, there's a 20% chance of a critical hit dealing 10 damage instead. An arrow fired from a dispenser always deals 3 damage.").."\n".. +S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons."), + _doc_items_usagehelp = S("To use arrows as ammunition for a bow, just put them anywhere in your inventory, they will be used up automatically. To use arrows as ammunition for a dispenser, place them in the dispenser's inventory. To retrieve an arrow that sticks in a block, simply walk close to it."), + inventory_image = "mcl_bows_rocket.png", + groups = { ammo=1, ammo_crossbow=1, ammo_bow_regular=1 }, + _on_dispense = function(itemstack, dispenserpos, droppos, dropnode, dropdir) + -- Shoot arrow + local shootpos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) + local yaw = math.atan2(dropdir.z, dropdir.x) + YAW_OFFSET + mcl_bows.shoot_arrow(itemstack:get_name(), shootpos, dropdir, yaw, nil, 19, 3) + end, +}) + + + +local ARROW_ENTITY={ + physical = true, + pointable = false, + visual = "mesh", + mesh = "mcl_bows_rocket.obj", + visual_size = {x=2.5, y=2.5}, + textures = {"mcl_bows_rocket.png"}, + collisionbox = {-0.19, -0.125, -0.19, 0.19, 0.125, 0.19}, + collide_with_objects = false, + _fire_damage_resistant = true, + + _lastpos={}, + _startpos=nil, + _damage=1, -- Damage on impact + _is_critical=false, -- Whether this arrow would deal critical damage + _stuck=false, -- Whether arrow is stuck + _fuse=nil,-- Amount of time (in seconds) the arrow has been stuck so far + _fuserechecktimer=nil,-- An additional timer for periodically re-checking the stuck status of an arrow + _stuckin=nil, --Position of node in which arow is stuck. + _shooter=nil, -- ObjectRef of player or mob who shot it + _is_arrow = true, + + _viscosity=0, -- Viscosity of node the arrow is currently in + _deflection_cooloff=0, -- Cooloff timer after an arrow deflection, to prevent many deflections in quick succession +} + +-- Destroy arrow entity self at pos and drops it as an item +local function spawn_item(self, pos) + if not minetest.is_creative_enabled("") then + local item = minetest.add_item(pos, "mcl_bows:rocket") + item:set_velocity({x=0, y=0, z=0}) + item:set_yaw(self.object:get_yaw()) + end + mcl_burning.extinguish(self.object) + self.object:remove() +end + +local function damage_particles(pos, is_critical) + if is_critical then + minetest.add_particlespawner({ + amount = 15, + time = 0.1, + minpos = {x=pos.x-0.5, y=pos.y-0.5, z=pos.z-0.5}, + maxpos = {x=pos.x+0.5, y=pos.y+0.5, z=pos.z+0.5}, + minvel = {x=-0.1, y=-0.1, z=-0.1}, + maxvel = {x=0.1, y=0.1, z=0.1}, + minacc = {x=0, y=0, z=0}, + maxacc = {x=0, y=0, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 1.5, + maxsize = 1.5, + collisiondetection = false, + vertical = false, + texture = "mcl_particles_crit.png^[colorize:#bc7a57:127", + }) + end +end + +function ARROW_ENTITY.on_step(self, dtime) + mcl_burning.tick(self.object, dtime, self) + + self._time_in_air = self._time_in_air + .001 + + + local pos = self.object:get_pos() + local dpos = table.copy(pos) -- digital pos + dpos = vector.round(dpos) + local node = minetest.get_node(dpos) + + if not self._fuse then + self._fuse = 0 + end + if not self._fuserechecktimer then + self._fuserechecktimer = 0 + end + + self._fuse = self._fuse + dtime + self._fuserechecktimer = self._fuserechecktimer + dtime + + if self._fuse > ARROW_TIMEOUT then + self._stuck = true + end + if self._stuck then + if self._fuse > ARROW_TIMEOUT then + local eploded_particle = particle_explosion(self) + damage_explosion(self, eploded_particle * 17) + mcl_burning.extinguish(self.object) + self.object:remove() + return + end + -- Drop arrow as item when it is no longer stuck + -- FIXME: Arrows are a bit slow to react and continue to float in mid air for a few seconds. + if self._fuserechecktimer > STUCK_RECHECK_TIME then + local stuckin_def + if self._stuckin then + stuckin_def = minetest.registered_nodes[minetest.get_node(self._stuckin).name] + end + -- TODO: In MC, arrow just falls down without turning into an item + if stuckin_def and stuckin_def.walkable == false then + spawn_item(self, pos) + return + end + self._fuserechecktimer = 0 + end + -- Pickup arrow if player is nearby (not in Creative Mode) + local objects = minetest.get_objects_inside_radius(pos, 1) + for _,obj in ipairs(objects) do + if obj:is_player() then + if self._collectable and not minetest.is_creative_enabled(obj:get_player_name()) then + if obj:get_inventory():room_for_item("main", "mcl_bows:rocket") then + obj:get_inventory():add_item("main", "mcl_bows:rocket") + minetest.sound_play("item_drop_pickup", { + pos = pos, + max_hear_distance = 16, + gain = 1.0, + }, true) + end + end + mcl_burning.extinguish(self.object) + self.object:remove() + return + end + end + + -- Check for object "collision". Done every tick (hopefully this is not too stressing) + else + + if self._in_player == false then + minetest.add_particlespawner({ + amount = 1, + time = .0001, + minpos = pos, + maxpos = pos, + minvel = vector.new(-0.1,-0.1,-0.1), + maxvel = vector.new(0.1,0.1,0.1), + minexptime = 0.5, + maxexptime = 0.5, + minsize = 2, + maxsize = 2, + collisiondetection = false, + vertical = false, + texture = "mcl_bows_rocket_particle.png", + glow = 1, + }) + end + -- We just check for any hurtable objects nearby. + -- The radius of 3 is fairly liberal, but anything lower than than will cause + -- arrow to hilariously go through mobs often. + -- TODO: Implement an ACTUAL collision detection (engine support needed). + local objs = minetest.get_objects_inside_radius(pos, 1.5) + local closest_object + local closest_distance + + if self._deflection_cooloff > 0 then + self._deflection_cooloff = self._deflection_cooloff - dtime + end + + -- Iterate through all objects and remember the closest attackable object + for k, obj in pairs(objs) do + local ok = false + -- Arrows can only damage players and mobs + if obj:is_player() then + ok = true + elseif obj:get_luaentity() then + if (obj:get_luaentity()._cmi_is_mob or obj:get_luaentity()._hittable_by_projectile) then + ok = true + end + end + + if ok then + local dist = vector.distance(pos, obj:get_pos()) + if not closest_object or not closest_distance then + closest_object = obj + closest_distance = dist + elseif dist < closest_distance then + closest_object = obj + closest_distance = dist + end + end + end + + -- If an attackable object was found, we will damage the closest one only + + if closest_object then + local obj = closest_object + local is_player = obj:is_player() + local lua = obj:get_luaentity() + if obj == self._shooter and self._time_in_air > 1.02 or obj ~= self._shooter and (is_player or (lua and (lua._cmi_is_mob or lua._hittable_by_projectile))) then + if obj:get_hp() > 0 then + -- Check if there is no solid node between arrow and object + local ray = minetest.raycast(self.object:get_pos(), obj:get_pos(), true) + for pointed_thing in ray do + if pointed_thing.type == "object" and pointed_thing.ref == closest_object then + -- Target reached! We can proceed now. + break + elseif pointed_thing.type == "node" then + local nn = minetest.get_node(minetest.get_pointed_thing_position(pointed_thing)).name + local def = minetest.registered_nodes[nn] + if (not def) or def.walkable then + -- There's a node in the way. Delete arrow without damage + mcl_burning.extinguish(self.object) + self.object:remove() + return + end + end + end + + -- Punch target object but avoid hurting enderman. + if not lua or lua.name ~= "mobs_mc:enderman" then + if self._in_player == false then + damage_particles(self.object:get_pos(), self._is_critical) + end + if mcl_burning.is_burning(self.object) then + mcl_burning.set_on_fire(obj, 5) + end + if self._in_player == false then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=self._damage}, + }, self.object:get_velocity()) + if obj:is_player() then + local eploded_particle = particle_explosion(self) + damage_explosion(self, eploded_particle * 17) + mcl_burning.extinguish(self.object) + self.object:remove() + end + end + end + + + if is_player then + if self._shooter and self._shooter:is_player() and self._in_player == false then + -- “Ding” sound for hitting another player + minetest.sound_play({name="mcl_bows_hit_player", gain=0.1}, {to_player=self._shooter:get_player_name()}, true) + end + end + + if lua then + local entity_name = lua.name + -- Achievement for hitting skeleton, wither skeleton or stray (TODO) with an arrow at least 50 meters away + -- NOTE: Range has been reduced because mobs unload much earlier than that ... >_> + -- TODO: This achievement should be given for the kill, not just a hit + if self._shooter and self._shooter:is_player() and vector.distance(pos, self._startpos) >= 20 then + if mod_awards and (entity_name == "mobs_mc:skeleton" or entity_name == "mobs_mc:stray" or entity_name == "mobs_mc:witherskeleton") then + awards.unlock(self._shooter:get_player_name(), "mcl:snipeSkeleton") + end + end + end + if self._in_player == false then + minetest.sound_play({name="mcl_bows_hit_other", gain=0.3}, {pos=self.object:get_pos(), max_hear_distance=16}, true) + end + end + if not obj:is_player() then + mcl_burning.extinguish(self.object) + if self._piercing == 0 then + local eploded_particle = particle_explosion(self) + damage_explosion(self, eploded_particle * 17) + self.object:remove() + end + end + return + end + end + end + + -- Check for node collision + if self._lastpos.x~=nil and not self._stuck then + local def = minetest.registered_nodes[node.name] + local vel = self.object:get_velocity() + -- Arrow has stopped in one axis, so it probably hit something. + -- This detection is a bit clunky, but sadly, MT does not offer a direct collision detection for us. :-( + if (math.abs(vel.x) < 0.0001) or (math.abs(vel.z) < 0.0001) or (math.abs(vel.y) < 0.00001) then + -- Check for the node to which the arrow is pointing + local dir + if math.abs(vel.y) < 0.00001 then + if self._lastpos.y < pos.y then + dir = {x=0, y=1, z=0} + else + dir = {x=0, y=-1, z=0} + end + else + dir = minetest.facedir_to_dir(minetest.dir_to_facedir(minetest.yaw_to_dir(self.object:get_yaw()-YAW_OFFSET))) + end + self._stuckin = vector.add(dpos, dir) + local snode = minetest.get_node(self._stuckin) + local sdef = minetest.registered_nodes[snode.name] + + -- If node is non-walkable, unknown or ignore, don't make arrow stuck. + -- This causes a deflection in the engine. + if not sdef or sdef.walkable == false or snode.name == "ignore" then + self._stuckin = nil + if self._deflection_cooloff <= 0 then + -- Lose 1/3 of velocity on deflection + local newvel = vector.multiply(vel, 0.6667) + + self.object:set_velocity(newvel) + -- Reset deflection cooloff timer to prevent many deflections happening in quick succession + self._deflection_cooloff = 1.0 + end + else + + -- Node was walkable, make arrow stuck + self._stuck = true + self._fuserechecktimer = 0 + + self.object:set_velocity({x=0, y=0, z=0}) + self.object:set_acceleration({x=0, y=0, z=0}) + + minetest.sound_play({name="mcl_bows_hit_other", gain=0.3}, {pos=self.object:get_pos(), max_hear_distance=16}, true) + + if mcl_burning.is_burning(self.object) and snode.name == "mcl_tnt:tnt" then + tnt.ignite(self._stuckin) + end + + -- Push the button! Push, push, push the button! + if mod_button and minetest.get_item_group(node.name, "button") > 0 and minetest.get_item_group(node.name, "button_push_by_arrow") == 1 then + local bdir = minetest.wallmounted_to_dir(node.param2) + -- Check the button orientation + if vector.equals(vector.add(dpos, bdir), self._stuckin) then + mesecon.push_button(dpos, node) + end + end + end + elseif (def and def.liquidtype ~= "none") then + -- Slow down arrow in liquids + local v = def.liquid_viscosity + if not v then + v = 0 + end + --local old_v = self._viscosity + self._viscosity = v + local vpenalty = math.max(0.1, 0.98 - 0.1 * v) + if math.abs(vel.x) > 0.001 then + vel.x = vel.x * vpenalty + end + if math.abs(vel.z) > 0.001 then + vel.z = vel.z * vpenalty + end + self.object:set_velocity(vel) + end + end + + -- Update yaw + if not self._stuck then + local vel = self.object:get_velocity() + local yaw = minetest.dir_to_yaw(vel)+YAW_OFFSET + local pitch = dir_to_pitch(vel) + self.object:set_rotation({ x = 0, y = yaw, z = pitch }) + end + + -- Update internal variable + self._lastpos={x=pos.x, y=pos.y, z=pos.z} +end + +-- Force recheck of stuck arrows when punched. +-- Otherwise, punching has no effect. +function ARROW_ENTITY.on_punch(self) + if self._stuck then + self._fuserechecktimer = STUCK_RECHECK_TIME + end +end + +function ARROW_ENTITY.get_staticdata(self) + local out = { + lastpos = self._lastpos, + startpos = self._startpos, + damage = self._damage, + is_critical = self._is_critical, + stuck = self._stuck, + stuckin = self._stuckin, + } + if self._stuck then + -- If _fuse is missing for some reason, assume the maximum + if not self._fuse then + self._fuse = ARROW_TIMEOUT + end + out.stuckstarttime = minetest.get_gametime() - self._fuse + end + if self._shooter and self._shooter:is_player() then + out.shootername = self._shooter:get_player_name() + end + return minetest.serialize(out) +end + +function ARROW_ENTITY.on_activate(self, staticdata, dtime_s) + self._time_in_air = 1.0 + self._in_player = false + local data = minetest.deserialize(staticdata) + if data then + self._stuck = data.stuck + if data.stuck then + if data.stuckstarttime then + -- First, check if the stuck arrow is aleady past its life timer. + -- If yes, delete it. + self._fuse = minetest.get_gametime() - data.stuckstarttime + if self._fuse > ARROW_TIMEOUT then + mcl_burning.extinguish(self.object) + self.object:remove() + return + end + end + + self._fuse = 2 + -- Perform a stuck recheck on the next step. + self._fuserechecktimer = STUCK_RECHECK_TIME + + self._stuckin = data.stuckin + end + + -- Get the remaining arrow state + self._lastpos = data.lastpos + self._startpos = data.startpos + self._damage = data.damage + self._is_critical = data.is_critical + if data.shootername then + local shooter = minetest.get_player_by_name(data.shootername) + if shooter and shooter:is_player() then + self._shooter = shooter + end + end + end + self.object:set_armor_groups({ immortal = 1 }) +end + +minetest.register_entity("mcl_bows:rocket_entity", ARROW_ENTITY) + +if minetest.get_modpath("mcl_core") and minetest.get_modpath("mcl_mobitems") then + minetest.register_craft({ + output = "mcl_bows:rocket 1", + recipe = { + {"mcl_core:paper"}, + {"mcl_fireworks:rocket_2"}, + {"mcl_bows:arrow"}, + } + }) +end + +if minetest.get_modpath("doc_identifier") then + doc.sub.identifier.register_object("mcl_bows:rocket_entity", "craftitems", "mcl_bows:rocket") +end diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_0.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_0.ogg new file mode 100644 index 0000000000..f4f81b3074 Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_0.ogg differ diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_1.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_1.ogg new file mode 100644 index 0000000000..c8c06b4fac Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_1.ogg differ diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_2.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_2.ogg new file mode 100644 index 0000000000..4ddd20c422 Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_drawback_2.ogg differ diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_load.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_load.ogg new file mode 100644 index 0000000000..02d2fd1afc Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_load.ogg differ diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_shoot.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_shoot.ogg new file mode 100644 index 0000000000..a7d7b69d12 Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_crossbow_shoot.ogg differ diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_firework.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_firework.ogg new file mode 100644 index 0000000000..ea9a4c4be5 Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_firework.ogg differ diff --git a/mods/ITEMS/mcl_bows/sounds/mcl_bows_firework_soft.ogg b/mods/ITEMS/mcl_bows/sounds/mcl_bows_firework_soft.ogg new file mode 100644 index 0000000000..8b2e7bc5bd Binary files /dev/null and b/mods/ITEMS/mcl_bows/sounds/mcl_bows_firework_soft.ogg differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow.png new file mode 100644 index 0000000000..b688dab947 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_0.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_0.png new file mode 100644 index 0000000000..41daad6d84 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_0.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_1.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_1.png new file mode 100644 index 0000000000..3769f2967b Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_1.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_2.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_2.png new file mode 100644 index 0000000000..b1bb50feb2 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_2.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_3.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_3.png new file mode 100644 index 0000000000..8a8f1b03fc Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_crossbow_3.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_blue.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_blue.png new file mode 100644 index 0000000000..608dbe0d0f Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_blue.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_green.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_green.png new file mode 100644 index 0000000000..acd74d6d1c Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_green.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_red.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_red.png new file mode 100644 index 0000000000..4d7355c57a Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_red.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_white.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_white.png new file mode 100644 index 0000000000..1860ee53c5 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_white.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_yellow.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_yellow.png new file mode 100644 index 0000000000..c2b745def7 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_firework_yellow.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_rocket.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_rocket.png new file mode 100644 index 0000000000..800185ce08 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_rocket.png differ diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_rocket_particle.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_rocket_particle.png new file mode 100644 index 0000000000..12a894c721 Binary files /dev/null and b/mods/ITEMS/mcl_bows/textures/mcl_bows_rocket_particle.png differ diff --git a/mods/ITEMS/mcl_enchanting/enchantments.lua b/mods/ITEMS/mcl_enchanting/enchantments.lua index ecc9fe1135..17b6b6ac69 100644 --- a/mods/ITEMS/mcl_enchanting/enchantments.lua +++ b/mods/ITEMS/mcl_enchanting/enchantments.lua @@ -379,8 +379,8 @@ mcl_enchanting.enchantments.mending = { inv_tool_tab = true, } --- requires missing MineClone2 feature ---[[mcl_enchanting.enchantments.multishot = { + +mcl_enchanting.enchantments.multishot = { name = S("Multishot"), max_level = 1, primary = {crossbow = true}, @@ -396,10 +396,10 @@ mcl_enchanting.enchantments.mending = { power_range_table = {{20, 50}}, inv_combat_tab = true, inv_tool_tab = false, -}]]-- +} -- requires missing MineClone2 feature ---[[mcl_enchanting.enchantments.piercing = { +mcl_enchanting.enchantments.piercing = { name = S("Piercing"), max_level = 4, primary = {crossbow = true}, @@ -415,7 +415,7 @@ mcl_enchanting.enchantments.mending = { power_range_table = {{1, 50}, {11, 50}, {21, 50}, {31, 50}}, inv_combat_tab = true, inv_tool_tab = false, -}]]-- +} -- implemented in mcl_bows mcl_enchanting.enchantments.power = { @@ -456,7 +456,7 @@ mcl_enchanting.enchantments.punch = { } -- requires missing MineClone2 feature ---[[mcl_enchanting.enchantments.quick_charge = { +mcl_enchanting.enchantments.quick_charge = { name = S("Quick Charge"), max_level = 3, primary = {crossbow = true}, @@ -472,7 +472,7 @@ mcl_enchanting.enchantments.punch = { power_range_table = {{12, 50}, {32, 50}, {52, 50}}, inv_combat_tab = true, inv_tool_tab = false, -}]]-- +} -- unimplemented --[[mcl_enchanting.enchantments.respiration = { diff --git a/mods/ITEMS/mcl_mobspawners/init.lua b/mods/ITEMS/mcl_mobspawners/init.lua index 6c5d7f6e43..b756d4a6d2 100644 --- a/mods/ITEMS/mcl_mobspawners/init.lua +++ b/mods/ITEMS/mcl_mobspawners/init.lua @@ -230,7 +230,7 @@ local function spawn_mobs(pos, elapsed) -- spawn up to 4 mobs in random air blocks if air then - local max = 4 + local max = 200 if spawn_count_overrides[mob] then max = spawn_count_overrides[mob] end @@ -387,4 +387,3 @@ minetest.register_lbm({ respawn_doll(pos) end, }) - diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index ab55cb72ad..1717533a8f 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -463,4 +463,4 @@ function mcl_potions.register_arrow(name, desc, color, def) if minetest.get_modpath("doc_identifier") then doc.sub.identifier.register_object("mcl_bows:arrow_entity", "craftitems", "mcl_bows:arrow") end -end \ No newline at end of file +end diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index a3c7697410..2a4c25c349 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -9,7 +9,7 @@ local animation_blend = 0 local function get_mouse_button(player) local controls = player:get_player_control() local get_wielded_item_name = player:get_wielded_item():get_name() - if controls.RMB and not string.find(get_wielded_item_name, "mcl_bows:bow") or controls.LMB then + if controls.RMB and not string.find(get_wielded_item_name, "mcl_bows:bow") and not string.find(get_wielded_item_name, "mcl_bows:crossbow") or controls.LMB then return true else return false @@ -212,9 +212,9 @@ minetest.register_globalstep(function(dtime) player_set_animation(player, "swim_walk_mine", animation_speed_mod) elseif not controls.sneak and head_in_water and is_sprinting == true then player_set_animation(player, "swim_walk", animation_speed_mod) - elseif string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and controls.sneak then + elseif string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and controls.sneak or string.find(player:get_wielded_item():get_name(), "mcl_bows:crossbow_") and controls.sneak then player_set_animation(player, "bow_sneak", animation_speed_mod) - elseif string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB then + elseif string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB or string.find(player:get_wielded_item():get_name(), "mcl_bows:crossbow_") then player_set_animation(player, "bow_walk", animation_speed_mod) elseif is_sprinting == true and get_mouse_button(player) == true and not controls.sneak and not head_in_water then player_set_animation(player, "run_walk_mine", animation_speed_mod) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 1f881d2b6d..f86d5e26a8 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -127,6 +127,7 @@ minetest.register_globalstep(function(dtime) for _,player in pairs(get_connected_players()) do --[[ + _ _ _ __ _ _ __ (_)_ __ ___ __ _| |_(_) ___ _ __ ___ / _` | '_ \| | '_ ` _ \ / _` | __| |/ _ \| '_ \/ __| @@ -220,6 +221,10 @@ minetest.register_globalstep(function(dtime) player:set_bone_position("Wield_Item", vector.new(0,3.9,1.3), vector.new(90,0,0)) elseif string.find(wielded:get_name(), "mcl_bows:bow") then player:set_bone_position("Wield_Item", vector.new(.5,4.5,-1.6), vector.new(90,0,20)) + elseif string.find(wielded:get_name(), "mcl_bows:crossbow_loaded") then + player:set_bone_position("Wield_Item", vector.new(-1.5,5.7,1.8), vector.new(64,90,0)) + elseif string.find(wielded:get_name(), "mcl_bows:crossbow") then + player:set_bone_position("Wield_Item", vector.new(-1.5,5.7,1.8), vector.new(90,90,0)) else player:set_bone_position("Wield_Item", vector.new(-1.5,4.9,1.8), vector.new(135,0,90)) end @@ -231,6 +236,14 @@ minetest.register_globalstep(function(dtime) if string.find(wielded:get_name(), "mcl_bows:bow") and control.RMB then player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35)) + -- controls right and left arms pitch when holing a loaded crossbow + elseif string.find(wielded:get_name(), "mcl_bows:crossbow_loaded") then + player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35)) + player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35)) + -- controls right and left arms pitch when loading a crossbow + elseif string.find(wielded:get_name(), "mcl_bows:crossbow_") then + player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(45,-20,25)) + player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(55,20,-45)) -- when punching elseif control.LMB and not parent then player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0))