mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
remove some ground around you when reviving from notplayer, dont have notplayer upwarp water when trying to douse himself
This commit is contained in:
parent
1020bf4e98
commit
2fa5e94d58
3 changed files with 15 additions and 4 deletions
|
@ -24,14 +24,22 @@ function module.on_player_died(player_entity)
|
|||
end
|
||||
|
||||
rpc.opts_everywhere()
|
||||
function rpc.remove_homing()
|
||||
local x, y = EntityGetTransform(ctx.rpc_player_data.entity)
|
||||
function rpc.remove_homing(clear_area)
|
||||
local x, y
|
||||
if ctx.rpc_peer_id == ctx.my_id then
|
||||
x, y = EntityGetTransform(ctx.rpc_player_data.entity)
|
||||
else
|
||||
x, y = ctx.rpc_player_data.pos_x, ctx.rpc_player_data.pos_y
|
||||
end
|
||||
for _, proj in pairs(EntityGetInRadiusWithTag(x, y, 512, "player_projectile")) do
|
||||
local homing = EntityGetFirstComponentIncludingDisabled(proj, "HomingComponent")
|
||||
if homing ~= nil and ComponentGetValue2(homing, "target_tag") ~= "ew_peer" then
|
||||
EntitySetComponentIsEnabled(proj, homing, false)
|
||||
end
|
||||
end
|
||||
if clear_area then
|
||||
LoadPixelScene("mods/quant.ew/files/system/local_health/revive.png", "", x - 6, y - 13, "", true, true)
|
||||
end
|
||||
end
|
||||
|
||||
local function set_camera_free(enable, entity, dont)
|
||||
|
@ -158,7 +166,7 @@ local function player_died()
|
|||
if ctx.my_player.entity == nil then
|
||||
return
|
||||
end
|
||||
rpc.remove_homing()
|
||||
rpc.remove_homing(false)
|
||||
-- Serialize inventory, perks, and max_hp, we'll need to copy it over to notplayer.
|
||||
local item_data = inventory_helper.get_item_data(ctx.my_player)
|
||||
remove_inventory()
|
||||
|
@ -329,10 +337,10 @@ ctx.cap.health = {
|
|||
on_poly_death = function()
|
||||
local notplayer_active = GameHasFlagRun("ew_flag_notplayer_active")
|
||||
if notplayer_active then
|
||||
rpc.remove_homing()
|
||||
if GameHasFlagRun("ending_game_completed") and not GameHasFlagRun("ew_kill_player") then
|
||||
return
|
||||
end
|
||||
rpc.remove_homing(true)
|
||||
local item_data = inventory_helper.get_item_data(ctx.my_player)
|
||||
remove_inventory()
|
||||
GameRemoveFlagRun("ew_flag_notplayer_active")
|
||||
|
|
BIN
quant.ew/files/system/local_health/revive.png
Normal file
BIN
quant.ew/files/system/local_health/revive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 313 B |
|
@ -859,6 +859,9 @@ local function choose_movement()
|
|||
end
|
||||
local did_hit_up, _, _ = RaytracePlatforms(my_x, my_y, my_x, my_y - 40)
|
||||
state.control_s = did_hit_up
|
||||
if did_hit_up and state.water_potion ~= nil then
|
||||
state.control_w = false
|
||||
end
|
||||
local air = ComponentGetValue2(state.damage_model, "air_in_lungs")
|
||||
if air < 1 then
|
||||
state.control_w = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue