fix mom orbs a bit

This commit is contained in:
bgkillas 2024-10-04 18:23:34 -04:00
parent 634c34fb15
commit f6db56ebce
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,21 @@
dofile_once("data/scripts/lib/utilities.lua")
local entity_id = GetUpdatedEntityID()
local boss_id = EntityGetRootEntity( entity_id )
local x,y = EntityGetTransform( boss_id )
local comp = EntityGetFirstComponent( entity_id, "VariableStorageComponent", "wizard_orb_id" )
if ( comp ~= nil ) then
local id = ComponentGetValue2( comp, "value_int" )
local count = 8
local circle = math.pi * 2
local inc = circle / count
local dir = inc * id + CrossCall("ew_host_frame_num") * 0.01
local nx = x + math.cos( dir ) * 50
local ny = y - math.sin( dir ) * 50 - 20
EntitySetTransform( entity_id, nx, ny )
end

View file

@ -24,8 +24,17 @@ ctx.init = function()
ctx.is_inventory_open = false
ctx.rpc_peer_id = nil
ctx.is_wand_pickup = false
ctx.host_frame_num = 0
end
np.CrossCallAdd("ew_host_frame_num", function()
if ctx.my_id == ctx.host_id then
return GameGetFrameNum()
else
return ctx.host_frame_num
end
end)
local function is_measure_perf_enabled()
-- return ctx.proxy_opt.debug
return false