mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
dont send map perk to peers, fix vomit/food clock potion on peers grabbing perks
This commit is contained in:
parent
343e48a362
commit
e673eb9930
5 changed files with 48 additions and 0 deletions
|
@ -19,6 +19,7 @@ local perks_to_ignore = {
|
|||
EXTRA_MANA = true,
|
||||
TELEKINESIS = true,
|
||||
HEARTS_MORE_EXTRA_HP = true,
|
||||
MAP = true,
|
||||
}
|
||||
|
||||
local global_perks = {
|
||||
|
|
8
quant.ew/files/system/map/append.lua
Normal file
8
quant.ew/files/system/map/append.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
local old = GameCreateSpriteForXFrames
|
||||
function GameCreateSpriteForXFrames(filename, ...)
|
||||
if filename == "data/particles/spatial_map_player.png" then
|
||||
CrossCall("ew_place_player_on_map")
|
||||
else
|
||||
old(filename, ...)
|
||||
end
|
||||
end
|
24
quant.ew/files/system/map/map.lua
Normal file
24
quant.ew/files/system/map/map.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
dofile_once("data/scripts/lib/utilities.lua")
|
||||
|
||||
ModLuaFileAppend("data/scripts/perks/map.lua", "mods/quant.ew/files/system/map/append.lua")
|
||||
|
||||
util.add_cross_call("ew_place_player_on_map", function()
|
||||
for peer_id, data in pairs(ctx.players) do
|
||||
local x, y = EntityGetTransform(data.entity)
|
||||
y = y - 4
|
||||
local _, mx = check_parallel_pos( x )
|
||||
local map_x = 0 * 512
|
||||
local map_y = 10 * 512
|
||||
|
||||
local mult_x = 512 / 6.0
|
||||
local mult_y = 512 / 6.0
|
||||
|
||||
local dx = math.min( math.max( ( map_x - mx ) / mult_x, -420), 420 )
|
||||
local dy = math.min( math.max( ( map_y - y ) / mult_y, -240), 240 )
|
||||
local pi_x = x - dx * 0.5
|
||||
local pi_y = y - dy * 0.5
|
||||
GameCreateSpriteForXFrames("data/particles/spatial_map_player.png", pi_x, pi_y, true, 0, 0, 1, true)
|
||||
end
|
||||
end)
|
||||
|
||||
return {}
|
|
@ -28,6 +28,20 @@ patch_perk_2("SHIELD", function(entity_perk_item, entity_who_picked, item_name,
|
|||
orig_fn(entity_perk_item, entity_who_picked, item_name, pickup_count)
|
||||
end)
|
||||
|
||||
patch_perk_2("FOOD_CLOCK", function(entity_perk_item, entity_who_picked, item_name, pickup_count, orig_fn)
|
||||
if entity_who_picked ~= EntityGetWithTag("player_unit")[1] then
|
||||
function EntityLoad() end
|
||||
end
|
||||
orig_fn(entity_perk_item, entity_who_picked, item_name, pickup_count)
|
||||
end)
|
||||
|
||||
patch_perk_2("VOMIT_RATS", function(entity_perk_item, entity_who_picked, item_name, pickup_count, orig_fn)
|
||||
if entity_who_picked ~= EntityGetWithTag("player_unit")[1] then
|
||||
function EntityLoad() end
|
||||
end
|
||||
orig_fn(entity_perk_item, entity_who_picked, item_name, pickup_count)
|
||||
end)
|
||||
|
||||
patch_perk_2("ATTACK_FOOT", function(entity_perk_item, entity_who_picked, item_name, pickup_count, orig_fn)
|
||||
if pickup_count ~= 1 then
|
||||
GameHasFlagRun("ATTACK_FOOT_CLIMBER")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue