mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
item_sync capability.
This commit is contained in:
parent
8a76a632cd
commit
6e4230c9c7
4 changed files with 28 additions and 1 deletions
|
@ -20,4 +20,12 @@ Provided by:
|
||||||
- damage (shared health) system
|
- damage (shared health) system
|
||||||
|
|
||||||
Used by:
|
Used by:
|
||||||
- heart pickups (core)
|
- heart pickups system
|
||||||
|
|
||||||
|
## 'item_sync' capability
|
||||||
|
|
||||||
|
Functions:
|
||||||
|
- `globalize(entity_id, instantly: bool)`
|
||||||
|
|
||||||
|
Provided by:
|
||||||
|
- item_sync system
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
-- Synchronizes item pickup and item drop
|
||||||
local inventory_helper = dofile_once("mods/quant.ew/files/src/inventory_helper.lua")
|
local inventory_helper = dofile_once("mods/quant.ew/files/src/inventory_helper.lua")
|
||||||
local ctx = dofile_once("mods/quant.ew/files/src/ctx.lua")
|
local ctx = dofile_once("mods/quant.ew/files/src/ctx.lua")
|
||||||
local net = dofile_once("mods/quant.ew/files/src/net.lua")
|
local net = dofile_once("mods/quant.ew/files/src/net.lua")
|
||||||
|
@ -210,5 +211,8 @@ function rpc.item_localize_req(gid)
|
||||||
item_sync.host_localize_item(gid, ctx.rpc_peer_id)
|
item_sync.host_localize_item(gid, ctx.rpc_peer_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ctx.cap.item_sync = {
|
||||||
|
globalize = item_sync.make_item_global
|
||||||
|
}
|
||||||
|
|
||||||
return item_sync
|
return item_sync
|
13
quant.ew/files/src/system/kolmi/kolmi.lua
Normal file
13
quant.ew/files/src/system/kolmi/kolmi.lua
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
local util = dofile_once("mods/quant.ew/files/src/util.lua")
|
||||||
|
local ctx = dofile_once("mods/quant.ew/files/src/ctx.lua")
|
||||||
|
local net = dofile_once("mods/quant.ew/files/src/net.lua")
|
||||||
|
local player_fns = dofile_once("mods/quant.ew/files/src/player_fns.lua")
|
||||||
|
local np = require("noitapatcher")
|
||||||
|
|
||||||
|
local rpc = net.new_rpc_namespace()
|
||||||
|
|
||||||
|
local module = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return module
|
|
@ -57,6 +57,8 @@ local function load_modules()
|
||||||
if ctx.proxy_opt.player_tether == "true" then
|
if ctx.proxy_opt.player_tether == "true" then
|
||||||
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/player_tether/player_tether.lua")
|
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/player_tether/player_tether.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/kolmi/kolmi.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, position_y, target_x, target_y, send_message,
|
function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, position_y, target_x, target_y, send_message,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue