noita_entangled_worlds/quant.ew/data/scripts/perks/levitation_trail.lua
2024-10-20 07:24:27 -04:00

16 lines
No EOL
605 B
Lua

dofile_once("data/scripts/lib/utilities.lua")
dofile_once("mods/quant.ew/files/resource/shoot_projectile_fix.lua")
local entity_id = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )
local comp = EntityGetFirstComponent(entity_id, "CharacterPlatformingComponent")
if comp == nil or ComponentGetValue2( comp, "mJetpackEmitting") < 1 then
return
end
local vel_x, vel_y = GameGetVelocityCompVelocity(entity_id)
vel_x = -vel_x * 75
vel_y = -vel_y * 50
shoot_projectile( entity_id, "data/entities/projectiles/levitation_trail.xml", pos_x, pos_y, vel_x, vel_y )