Make grenade work, make grenades less rare

This commit is contained in:
rubenwardy 2016-04-05 23:21:50 +01:00
parent 384af5d073
commit 2321195c7a
9 changed files with 33 additions and 32 deletions

View file

@ -0,0 +1,2 @@
First person shooter mod.
Adds firearms plus a few other fun items.

1
mods/shooter/mod.conf Normal file
View file

@ -0,0 +1 @@
name = shooter

BIN
mods/shooter/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View file

@ -393,7 +393,7 @@ function shooter:blast(pos, radius, fleshy, distance, user)
obj_pos.y = obj_pos.y + 1.7
blast_pos = {x=pos.x, y=pos.y + 4, z=pos.z}
if minetest.line_of_sight(obj_pos, blast_pos, 1) then
obj:punch(obj, 1.0, {
obj:punch(obj, 2.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy=damage},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View file

@ -80,22 +80,12 @@ minetest.register_entity("shooter:turret_entity", {
get_turret_entity(self.pos)
end,
on_rightclick = function(self, clicker)
if self.player == nil then
if self.player then
self.player:set_detach()
self.player = nil
else
clicker:set_attach(self.object, "", {x=0,y=5,z=-8}, {x=0,y=0,z=0})
self.player = clicker
else
self.player:set_detach()
local yaw = self.yaw + math.pi / 2
local dir = vector.normalize({
x = math.cos(yaw),
y = 0,
z = math.sin(yaw),
})
local pos = vector.subtract(self.player:getpos(), dir)
minetest.after(0.2, function(player)
player:setpos(pos)
end, self.player)
self.player = nil
end
end,
on_step = function(self, dtime)