Dateien nach "/" hochladen

This commit is contained in:
2026-03-07 11:55:09 +00:00
parent b22d4c78c9
commit 71e37ac1c7
3 changed files with 160 additions and 6 deletions

8
ai.lua
View File

@@ -113,6 +113,14 @@ local function try_fire(self_ent, target_pos)
local cd = weapon == "plasma" and SHOOT_COOLDOWN_PLASMA or SHOOT_COOLDOWN_BULLET
if (now - (self_ent._ai_last_shot or 0)) < cd then return false end
-- Spider-Ammo pruefen
if weapon == "plasma" then
local ammo = self_ent._spider_ammo or SPIDER_AMMO_MAX
if ammo < SPIDER_AMMO_MIN_TO_FIRE then return false end
-- Ammo verbrauchen
self_ent._spider_ammo = math.max(0, ammo - SPIDER_AMMO_COST)
end
local my_pos = self_ent.object:get_pos()
local aim = {x=target_pos.x, y=target_pos.y+1.2, z=target_pos.z}
local origin = {x=my_pos.x, y=my_pos.y+4.0, z=my_pos.z}