mirror of
https://github.com/Noodlemire/projectile.git
synced 2024-12-12 08:43:18 +01:00
1.1.1: node_damage support
This commit is contained in:
parent
d940c3f10e
commit
d7da9ca3d0
@ -20,3 +20,6 @@ v1.1.0:
|
||||
-Issues with weapons thinking they're still charged if the player leaves the game, even though they shouldn't be.
|
||||
-Possible crash if a projectile ever called self.object:remove() in its _on_step function.
|
||||
-Dead players will no longer block projectiles.
|
||||
|
||||
v1.1.1:
|
||||
Added optional support for my new node_damage mod. With it an tnt, bomb arrows will crack blocks just outside the destruction radius.
|
||||
|
17
init.lua
17
init.lua
@ -397,7 +397,24 @@ if tnt then
|
||||
|
||||
--Upon impact, create a small explosion.
|
||||
on_impact = function(self, collisions)
|
||||
local pos = self.object:get_pos()
|
||||
local r = 4
|
||||
|
||||
tnt.boom(self.object:get_pos(), {radius = 2, damage_radius = 2})
|
||||
|
||||
for a = -r, r do
|
||||
for b = -r, r do
|
||||
for c = -r, r do
|
||||
local npos = vector.add(pos, {x=a, y=b, z=c})
|
||||
local dist = vector.distance(pos, npos)
|
||||
local num = math.random(0, math.ceil(r / math.max(1, dist)))
|
||||
|
||||
if dist <= r and num > 0 then
|
||||
node_damage.damage(npos, nil, nil, num)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
|
2
mod.conf
2
mod.conf
@ -1,3 +1,3 @@
|
||||
name = projectile
|
||||
description = Adds a small slingshot that can launch certain small objects as projectiles, such as rocks.
|
||||
optional_depends = animalmaterials, creatures, default, farming, fire, hardtrees, mesecons_walllever, mesecons, mobs, moreores, parties, pipeworks, tnt
|
||||
optional_depends = animalmaterials, creatures, default, farming, fire, hardtrees, mesecons_walllever, mesecons, mobs, moreores, node_damage, parties, pipeworks, tnt
|
||||
|
Loading…
Reference in New Issue
Block a user