mirror of
https://github.com/lhofhansl/rangedweapons.git
synced 2024-11-19 22:03:57 +01:00
Make bullet maximum lifetime configurable
This commit is contained in:
parent
ff4c974a7e
commit
d719189262
3
ammo.lua
3
ammo.lua
@ -27,6 +27,7 @@ initial_properties = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local use_particles = minetest.settings:get_bool("rangedweapons_impact_particles", true)
|
local use_particles = minetest.settings:get_bool("rangedweapons_impact_particles", true)
|
||||||
|
local max_lifetime = tonumber(minetest.settings:get("rangedweapons_bullet_lifetime")) or 10.0
|
||||||
|
|
||||||
rangedweapons_shot_bullet.on_step = function(self, dtime, moveresult)
|
rangedweapons_shot_bullet.on_step = function(self, dtime, moveresult)
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
@ -66,7 +67,7 @@ self.object:set_properties({collide_with_objects = true})
|
|||||||
self.object:set_properties({collisionbox = {-size, -size, -size, size, size, size}})
|
self.object:set_properties({collisionbox = {-size, -size, -size, size, size, size}})
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.timer > 10 then
|
if self.timer > max_lifetime then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@ rangedweapons_other_weapon_crafting (Other Weapon Crafting) bool true
|
|||||||
# If true, a gun can always be reloaded (just need at least one matching bullet in the inventory)
|
# If true, a gun can always be reloaded (just need at least one matching bullet in the inventory)
|
||||||
rangedweapons_infinite_ammo (Inifinite Ammo) bool false
|
rangedweapons_infinite_ammo (Inifinite Ammo) bool false
|
||||||
|
|
||||||
|
# Maximum lifetime of a bullet (or rocket)
|
||||||
|
rangedweapons_bullet_lifetime (Bullet Lifetime) int 10
|
||||||
|
|
||||||
# Damage multiplier for hits on other players
|
# Damage multiplier for hits on other players
|
||||||
rangedweapons_player_dmg_multiplier (Player Damage Multiplier) float 1.0
|
rangedweapons_player_dmg_multiplier (Player Damage Multiplier) float 1.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user