mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
sync levi, maybe fix pyramid boss rewards, fix worms error, dont sync tower wands in generation
This commit is contained in:
parent
7f13a03d85
commit
b8e16e1f1f
5 changed files with 35 additions and 7 deletions
|
@ -92,12 +92,21 @@ function inventory_helper.serialize_single_item(item)
|
||||||
if vel and vel ~= 0 then
|
if vel and vel ~= 0 then
|
||||||
vx, vy = ComponentGetValue2(vel, "mVelocity")
|
vx, vy = ComponentGetValue2(vel, "mVelocity")
|
||||||
end
|
end
|
||||||
local sprite = EntityGetFirstComponentIncludingDisabled(item, "SpriteComponent")
|
local sprite_com = EntityGetFirstComponentIncludingDisabled(item, "SpriteComponent")
|
||||||
if sprite ~= nil then
|
local animation
|
||||||
sprite = ComponentGetValue2(sprite, "image_file")
|
local sprite
|
||||||
|
if sprite_com ~= nil and sprite_com ~= 0 then
|
||||||
|
sprite = ComponentGetValue2(sprite_com, "image_file")
|
||||||
|
animation = ComponentGetValue2(sprite_com, "rect_animation")
|
||||||
|
end
|
||||||
|
local shoot_pos = {}
|
||||||
|
local hotspot = EntityGetFirstComponentIncludingDisabled(item, "HotspotComponent")
|
||||||
|
if hotspot ~= nil and hotspot ~= 0 then
|
||||||
|
shoot_pos[1], shoot_pos[2] = ComponentGetValue2(hotspot, "offset")
|
||||||
end
|
end
|
||||||
local varp = EntityGetFilename(item) == "data/entities/items/wand_varpuluuta.xml"
|
local varp = EntityGetFilename(item) == "data/entities/items/wand_varpuluuta.xml"
|
||||||
item_data = {true, wand:Serialize(true, true), x, y, extra, is_new, {vx, vy}, sprite, image_inv, varp}
|
item_data = {true, wand:Serialize(true, true), x, y, extra, is_new, {vx, vy},
|
||||||
|
sprite, image_inv, varp, shoot_pos, animation}
|
||||||
else
|
else
|
||||||
item_data = {false, util.serialize_entity(item), x, y}
|
item_data = {false, util.serialize_entity(item), x, y}
|
||||||
end
|
end
|
||||||
|
@ -121,9 +130,17 @@ function inventory_helper.deserialize_single_item(item_data)
|
||||||
local vx, vy = item_data[7][1], item_data[7][2]
|
local vx, vy = item_data[7][1], item_data[7][2]
|
||||||
local image = item_data[8]
|
local image = item_data[8]
|
||||||
local image_inv = item_data[9]
|
local image_inv = item_data[9]
|
||||||
|
local shoot_pos = item_data[11]
|
||||||
|
local animation = item_data[12]
|
||||||
local sprite = EntityGetFirstComponentIncludingDisabled(item, "SpriteComponent")
|
local sprite = EntityGetFirstComponentIncludingDisabled(item, "SpriteComponent")
|
||||||
if sprite ~= nil then
|
if sprite ~= nil then
|
||||||
ComponentSetValue2(sprite, "image_file", image)
|
ComponentSetValue2(sprite, "image_file", image)
|
||||||
|
ComponentSetValue2(sprite, "rect_animation", animation)
|
||||||
|
ComponentSetValue2(sprite, "next_rect_animation", animation)
|
||||||
|
end
|
||||||
|
local hotspot = EntityGetFirstComponentIncludingDisabled(item, "HotspotComponent")
|
||||||
|
if hotspot ~= nil then
|
||||||
|
ComponentSetValue2(hotspot, "offset", shoot_pos[1], shoot_pos[2])
|
||||||
end
|
end
|
||||||
if item_data[10] then
|
if item_data[10] then
|
||||||
local varp = EntityCreateNew()
|
local varp = EntityCreateNew()
|
||||||
|
|
|
@ -117,6 +117,9 @@ local function get_sync_entities(return_all)
|
||||||
table_extend(entities, EntityGetWithTag("seed_c"))
|
table_extend(entities, EntityGetWithTag("seed_c"))
|
||||||
table_extend(entities, EntityGetWithTag("perk_fungus_tiny"))
|
table_extend(entities, EntityGetWithTag("perk_fungus_tiny"))
|
||||||
table_extend(entities, EntityGetWithTag("helpless_animal"))
|
table_extend(entities, EntityGetWithTag("helpless_animal"))
|
||||||
|
table_extend_filtered(entities, EntityGetWithTag("touchmagic_immunity"), function(ent)
|
||||||
|
return EntityGetName(ent) == "$animal_fish_giga"
|
||||||
|
end)
|
||||||
table_extend_filtered(entities, EntityGetWithTag("prop_physics"), function (ent)
|
table_extend_filtered(entities, EntityGetWithTag("prop_physics"), function (ent)
|
||||||
local f = EntityGetFilename(ent)
|
local f = EntityGetFilename(ent)
|
||||||
if f ~= nil then
|
if f ~= nil then
|
||||||
|
@ -659,7 +662,10 @@ function rpc.handle_death_data(death_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
EntityInflictDamage(enemy_id, 1000000000, "DAMAGE_CURSE", "", "NONE", 0, 0, responsible_entity) -- Just to be sure
|
EntityInflictDamage(enemy_id, 1000000000, "DAMAGE_CURSE", "", "NONE", 0, 0, responsible_entity) -- Just to be sure
|
||||||
|
async(function()
|
||||||
|
wait(1)
|
||||||
EntityKill(enemy_id)
|
EntityKill(enemy_id)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,6 +27,10 @@ local function is_sync_item(ent_path)
|
||||||
if exclude[ent_path] then
|
if exclude[ent_path] then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
local good = "data/entities/items/wands/wand_good"
|
||||||
|
if string.sub(ent_path, 1, #good) == good then
|
||||||
|
return false
|
||||||
|
end
|
||||||
local start = "data/entities/items/"
|
local start = "data/entities/items/"
|
||||||
if string.sub(ent_path, 1, #start) == start then
|
if string.sub(ent_path, 1, #start) == start then
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -4,7 +4,7 @@ local function get_closest_alive(x, y)
|
||||||
local min_dist
|
local min_dist
|
||||||
local min_ent
|
local min_ent
|
||||||
for _, player in pairs(ctx.players) do
|
for _, player in pairs(ctx.players) do
|
||||||
if player.status.is_alive then
|
if not EntityHasTag(player.entity, "ew_notplayer") then
|
||||||
local tx, ty = EntityGetTransform(player.entity)
|
local tx, ty = EntityGetTransform(player.entity)
|
||||||
local dx, dy = tx - x, ty - y
|
local dx, dy = tx - x, ty - y
|
||||||
local dist = dx * dx + dy * dy
|
local dist = dx * dx + dy * dy
|
||||||
|
|
|
@ -26,7 +26,8 @@ constants = dofile_once("mods/quant.ew/files/core/constants.lua")
|
||||||
|
|
||||||
local perk_fns = dofile_once("mods/quant.ew/files/core/perk_fns.lua")
|
local perk_fns = dofile_once("mods/quant.ew/files/core/perk_fns.lua")
|
||||||
|
|
||||||
local version = dofile_once("mods/quant.ew/files/version.lua") or "unknown (dev build)"
|
local version = ModDoesFileExist("mods/quant.ew/files/version.lua") and dofile_once("mods/quant.ew/files/version.lua")
|
||||||
|
or "unknown (dev build)"
|
||||||
print("Noita EW version: "..version)
|
print("Noita EW version: "..version)
|
||||||
|
|
||||||
dofile_once("data/scripts/lib/coroutines.lua")
|
dofile_once("data/scripts/lib/coroutines.lua")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue