mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
fix some errors
This commit is contained in:
parent
96c7607436
commit
21af576be3
4 changed files with 8 additions and 10 deletions
|
@ -145,7 +145,7 @@ local function player_died()
|
|||
-- This may look like a hack, but it allows to use existing poly machinery to change player entity AND to store the original player for later,
|
||||
-- Which is, like, perfect.
|
||||
local ent = LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/local_health/notplayer/poly_effect.xml")
|
||||
ctx.my_player.entity = ent + 1
|
||||
polymorph.switch_entity(ent + 1)
|
||||
GameAddFlagRun("ew_flag_notplayer_active")
|
||||
do_switch_effect(false)
|
||||
EntitySetName(ctx.my_player.entity, ctx.my_id.."?")
|
||||
|
@ -154,7 +154,6 @@ local function player_died()
|
|||
EntityAddTag(iron, "kill_on_revive")
|
||||
LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/spectate/no_tinker.xml")
|
||||
set_cosmetics_locally(ctx.my_id)
|
||||
polymorph.switch_entity(ent + 1)
|
||||
|
||||
remove_healthbar_locally()
|
||||
for _, child in ipairs(EntityGetAllChildren(ctx.my_player.entity) or {}) do
|
||||
|
@ -184,8 +183,8 @@ local function do_game_over(message)
|
|||
if damage_model ~= nil and #(EntityGetAllChildren(ctx.my_player.entity) or {}) ~= 0 then
|
||||
set_camera_free(true)
|
||||
GameRemoveFlagRun("ew_cam_wait")
|
||||
ctx.my_player.entity = end_poly_effect(ctx.my_player.entity)
|
||||
polymorph.switch_entity(ctx.my_player.entity)
|
||||
local ent = end_poly_effect(ctx.my_player.entity)
|
||||
polymorph.switch_entity(ent)
|
||||
if ctx.my_player.entity ~= nil then
|
||||
ComponentSetValue2(damage_model, "wait_for_kill_flag_on_death", false)
|
||||
EntityInflictDamage(ctx.my_player.entity, 1000000, "DAMAGE_CURSE", message, "NONE", 0, 0, GameGetWorldStateEntity())
|
||||
|
@ -306,7 +305,7 @@ ctx.cap.health = {
|
|||
remove_inventory()
|
||||
GameRemoveFlagRun("ew_flag_notplayer_active")
|
||||
local ent = end_poly_effect(ctx.my_player.entity)
|
||||
ctx.my_player.entity = ent
|
||||
polymorph.switch_entity(ent)
|
||||
for _, child in ipairs(EntityGetAllChildren(ctx.my_player.entity) or {}) do
|
||||
if not EntityHasTag(child, "perk_entity") then
|
||||
local com = EntityGetFirstComponentIncludingDisabled(child, "GameEffectComponent")
|
||||
|
@ -340,7 +339,6 @@ ctx.cap.health = {
|
|||
end
|
||||
if GameHasFlagRun("ew_kill_player") then
|
||||
GameRemoveFlagRun("ew_kill_player")
|
||||
polymorph.switch_entity(ent)
|
||||
async(function()
|
||||
wait(1)
|
||||
if GameHasFlagRun("ending_game_completed") then
|
||||
|
@ -351,11 +349,9 @@ ctx.cap.health = {
|
|||
end)
|
||||
else
|
||||
do_switch_effect(true)
|
||||
polymorph.switch_entity(ent)
|
||||
end
|
||||
else
|
||||
local ent = end_poly_effect(ctx.my_player.entity)
|
||||
ctx.my_player.entity = ent
|
||||
polymorph.switch_entity(ent)
|
||||
async(function()
|
||||
wait(1)
|
||||
|
|
|
@ -67,6 +67,9 @@ function module.on_world_update()
|
|||
for peer_id, player in pairs(ctx.players) do
|
||||
local ent = player.entity
|
||||
local x, y = EntityGetTransform(ent)
|
||||
if x == nil or not EntityGetIsAlive(ent) or EntityHasTag(ent, "polymorphed") then
|
||||
return
|
||||
end
|
||||
local dx, dy = x - mx, y - my
|
||||
local cape
|
||||
for _, child in ipairs(EntityGetAllChildren(ent) or {}) do
|
||||
|
|
|
@ -2,7 +2,6 @@ local util = dofile_once("mods/quant.ew/files/core/util.lua")
|
|||
local ctx = dofile_once("mods/quant.ew/files/core/ctx.lua")
|
||||
local net = dofile_once("mods/quant.ew/files/core/net.lua")
|
||||
local player_fns = dofile_once("mods/quant.ew/files/core/player_fns.lua")
|
||||
local wandfinder = dofile_once("mods/quant.ew/files/system/notplayer_ai/wandfinder.lua")
|
||||
local np = require("noitapatcher")
|
||||
|
||||
local rpc = net.new_rpc_namespace()
|
||||
|
|
|
@ -118,7 +118,7 @@ function module.on_world_update()
|
|||
end
|
||||
end
|
||||
end
|
||||
if his_x == nil then
|
||||
if his_x == nil or my_x == nil then
|
||||
goto continue
|
||||
end
|
||||
local dx, dy = his_x - my_x, his_y - my_y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue