mirror of
https://github.com/Noodlemire/projectile.git
synced 2025-03-02 16:14:39 +01:00
1.1.1: node_damage support
This commit is contained in:
@ -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.
|
-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.
|
-Possible crash if a projectile ever called self.object:remove() in its _on_step function.
|
||||||
-Dead players will no longer block projectiles.
|
-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.
|
--Upon impact, create a small explosion.
|
||||||
on_impact = function(self, collisions)
|
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})
|
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
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,3 +1,3 @@
|
|||||||
name = projectile
|
name = projectile
|
||||||
description = Adds a small slingshot that can launch certain small objects as projectiles, such as rocks.
|
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
|
||||||
|
Reference in New Issue
Block a user