add visible damage points
10
README.md
|
@ -130,6 +130,16 @@ Modified by SaKeL:
|
|||
- x_bows_quiver_empty_mesh.png
|
||||
- x_bows_quiver_blank_mesh.png
|
||||
- x_bows_quiver_slot.png
|
||||
- x_bows_dmg_0.png
|
||||
- x_bows_dmg_1.png
|
||||
- x_bows_dmg_2.png
|
||||
- x_bows_dmg_3.png
|
||||
- x_bows_dmg_4.png
|
||||
- x_bows_dmg_5.png
|
||||
- x_bows_dmg_6.png
|
||||
- x_bows_dmg_7.png
|
||||
- x_bows_dmg_8.png
|
||||
- x_bows_dmg_9.png
|
||||
|
||||
### Sounds
|
||||
|
||||
|
|
8
api.lua
|
@ -2379,13 +2379,15 @@ function XBowsQuiver.hide_3d_quiver(self, player)
|
|||
end
|
||||
end
|
||||
|
||||
---string split to characters
|
||||
---@param str string
|
||||
---@return string[] | nil
|
||||
local function split(str)
|
||||
if #str > 0 then
|
||||
return str:sub(1,1), split(str:sub(2))
|
||||
end
|
||||
end
|
||||
|
||||
---Show damage numbers
|
||||
function XBows.show_damage_numbers(self, pos, damage, is_crit)
|
||||
if not pos or not self.settings.x_bows_show_damage_numbers then
|
||||
return
|
||||
|
@ -2399,9 +2401,9 @@ function XBows.show_damage_numbers(self, pos, damage, is_crit)
|
|||
|
||||
for i, value in ipairs(results) do
|
||||
if i == 1 then
|
||||
texture = texture .. '[combine:' .. 7 * #results .. 'x' .. 9 * #results .. ':0,0=dmg_' .. value .. '.png'
|
||||
texture = texture .. '[combine:' .. 7 * #results .. 'x' .. 9 * #results .. ':0,0=x_bows_dmg_' .. value .. '.png'
|
||||
else
|
||||
texture = texture .. ':' .. dmg_nr_offset .. ',0=dmg_' .. value .. '.png'
|
||||
texture = texture .. ':' .. dmg_nr_offset .. ',0=x_bows_dmg_' .. value .. '.png'
|
||||
end
|
||||
|
||||
dmg_nr_offset = dmg_nr_offset + 7
|
||||
|
|
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 80 B |
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 80 B |
Before Width: | Height: | Size: 85 B After Width: | Height: | Size: 85 B |
Before Width: | Height: | Size: 81 B After Width: | Height: | Size: 81 B |
Before Width: | Height: | Size: 91 B After Width: | Height: | Size: 91 B |
Before Width: | Height: | Size: 83 B After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 85 B After Width: | Height: | Size: 85 B |
Before Width: | Height: | Size: 81 B After Width: | Height: | Size: 81 B |
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 80 B |
Before Width: | Height: | Size: 86 B After Width: | Height: | Size: 86 B |
|
@ -32,6 +32,7 @@
|
|||
---@field open_quiver fun(self: XBowsQuiver, itemstack: ItemStack, user: ObjectRef): ItemStack Open quiver
|
||||
---@field uuid fun(): string Creates UUID
|
||||
---@field fallback_quiver boolean If no invenotory mod is detected then fallback solution will be used
|
||||
---@field show_damage_numbers fun(self: XBows, pos: Vector, damaga: number, is_crit?: boolean): nil Builds textures and shows textures in particle spawner
|
||||
|
||||
|
||||
---XBowsQuiver class extended from XBows
|
||||
|
|