From a1cce5d6e6e08ee98f87223ffa0661d667e38f8d Mon Sep 17 00:00:00 2001 From: bgkillas Date: Sat, 2 Nov 2024 09:16:43 -0400 Subject: [PATCH] increase safe effect on notplayer to player revive from 60f to 100f, since material damage is dealt with better now, remove homing on both notplayer to player and player to notplayer revive, display who has won in end fight, have hue slider only effect the color with the color picker out, or all if none are out --- noita-proxy/src/lib.rs | 34 +++++++++++++++---- quant.ew/files/system/end_fight/end_fight.lua | 1 + .../system/local_health/local_health.lua | 13 +++++++ .../local_health/notplayer/safe_effect2.xml | 2 +- .../system/notplayer_ai/notplayer_ai.lua | 16 +-------- .../patch_dragon_boss/dragonspot_script.lua | 7 ++-- 6 files changed, 47 insertions(+), 26 deletions(-) diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 03edd6c3..8e68ee8a 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -805,12 +805,34 @@ impl App { ui.style_mut().spacing.slider_width = old; if old_hue != self.appearance.hue { let diff = self.appearance.hue - old_hue; - shift_hue(diff, &mut self.appearance.player_color.player_main); - shift_hue(diff, &mut self.appearance.player_color.player_alt); - shift_hue(diff, &mut self.appearance.player_color.player_arm); - shift_hue(diff, &mut self.appearance.player_color.player_forearm); - shift_hue(diff, &mut self.appearance.player_color.player_cape); - shift_hue(diff, &mut self.appearance.player_color.player_cape_edge); + match self.appearance.player_picker { + PlayerPicker::PlayerAlt => { + shift_hue(diff, &mut self.appearance.player_color.player_alt); + } + PlayerPicker::PlayerArm => { + shift_hue(diff, &mut self.appearance.player_color.player_arm); + } + PlayerPicker::PlayerCape => { + shift_hue(diff, &mut self.appearance.player_color.player_cape); + } + PlayerPicker::PlayerForearm => { + shift_hue(diff, &mut self.appearance.player_color.player_forearm); + } + PlayerPicker::PlayerCapeEdge => { + shift_hue(diff, &mut self.appearance.player_color.player_cape_edge); + } + PlayerPicker::PlayerMain => { + shift_hue(diff, &mut self.appearance.player_color.player_main); + } + PlayerPicker::None => { + shift_hue(diff, &mut self.appearance.player_color.player_main); + shift_hue(diff, &mut self.appearance.player_color.player_alt); + shift_hue(diff, &mut self.appearance.player_color.player_arm); + shift_hue(diff, &mut self.appearance.player_color.player_forearm); + shift_hue(diff, &mut self.appearance.player_color.player_cape); + shift_hue(diff, &mut self.appearance.player_color.player_cape_edge); + } + } } ui.horizontal(|ui| { display_player_skin(ui, self); diff --git a/quant.ew/files/system/end_fight/end_fight.lua b/quant.ew/files/system/end_fight/end_fight.lua index db1b3304..cadedbe8 100644 --- a/quant.ew/files/system/end_fight/end_fight.lua +++ b/quant.ew/files/system/end_fight/end_fight.lua @@ -100,6 +100,7 @@ function rpc.try_kill(x, y) end end end) + GamePrintImportant(ctx.rpc_player_data.name .. " has won") end local function remove_fire(entity) diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index a081fcee..8d84be05 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -23,6 +23,17 @@ function module.on_player_died(player_entity) -- Also inventory items seem to be borked. end +rpc.opts_everywhere() +function rpc.remove_homing() + local x, y = EntityGetTransform(ctx.rpc_player_data.entity) + 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 +end + local function set_camera_free(enable, entity, dont) local cam = EntityGetFirstComponentIncludingDisabled(entity, "PlatformShooterPlayerComponent") if cam ~= nil then @@ -147,6 +158,7 @@ local function player_died() if ctx.my_player.entity == nil then return end + rpc.remove_homing() -- 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() @@ -317,6 +329,7 @@ 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 diff --git a/quant.ew/files/system/local_health/notplayer/safe_effect2.xml b/quant.ew/files/system/local_health/notplayer/safe_effect2.xml index 45a9266c..62f692a9 100644 --- a/quant.ew/files/system/local_health/notplayer/safe_effect2.xml +++ b/quant.ew/files/system/local_health/notplayer/safe_effect2.xml @@ -4,7 +4,7 @@ diff --git a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua index a1acd3ed..37664eea 100644 --- a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua +++ b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua @@ -449,19 +449,6 @@ local function fire_wand(enable) end end -local rpc = net.new_rpc_namespace() - -rpc.opts_everywhere() -function rpc.remove_homing() - local x, y = EntityGetTransform(ctx.rpc_player_data.entity) - 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 -end - local function init_state() EntityAddTag(ctx.my_player.entity, "teleportable") EntityAddComponent2(ctx.my_player.entity, "SpriteComponent", { @@ -477,7 +464,6 @@ local function init_state() z_index = -10000, emissive = 1, }) - rpc.remove_homing() local damage_model = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent") if ctx.proxy_opt.no_material_damage then ComponentSetValue2(damage_model, "materials_damage", false) @@ -1234,7 +1220,7 @@ local function find_target() local root_id = ctx.my_player.entity local pos_x, pos_y = EntityGetTransform(root_id) for _, id in pairs(EntityGetInRadiusWithTag(pos_x, pos_y, 256, "mortal")) do - if EntityGetComponent(id, "GenomeDataComponent") ~= nil and EntityGetComponent(root_id, "GenomeDataComponent") ~= nil and EntityGetHerdRelation(root_id, id) < -100 then + if EntityGetComponent(id, "GenomeDataComponent") ~= nil and EntityGetComponent(root_id, "GenomeDataComponent") ~= nil and EntityGetHerdRelation(root_id, id) < -10 then local t_x, t_y = EntityGetTransform(id) local did_hit, _, _ = RaytracePlatforms(x, y, t_x, t_y) local dx = x - t_x diff --git a/quant.ew/files/system/patch_dragon_boss/dragonspot_script.lua b/quant.ew/files/system/patch_dragon_boss/dragonspot_script.lua index e495971e..af2fa1e4 100644 --- a/quant.ew/files/system/patch_dragon_boss/dragonspot_script.lua +++ b/quant.ew/files/system/patch_dragon_boss/dragonspot_script.lua @@ -1,13 +1,12 @@ dofile_once("data/scripts/lib/utilities.lua") function collision_trigger() - if not GameHasFlagRun("ew_flag_this_is_host") then - return - end local entity_id = GetUpdatedEntityID() local pos_x, pos_y = EntityGetTransform( entity_id ) - EntityLoad( "mods/quant.ew/files/system/patch_dragon_boss/dragon_boss_extra.xml", pos_x, pos_y ) + if GameHasFlagRun("ew_flag_this_is_host") then + EntityLoad( "mods/quant.ew/files/system/patch_dragon_boss/dragon_boss_extra.xml", pos_x, pos_y ) + end EntityLoad( "data/entities/particles/image_emitters/magical_symbol_fast.xml", pos_x, pos_y ) EntityKill( entity_id )