diff --git a/noita-proxy/assets/lang/en-US/main.ftl b/noita-proxy/assets/lang/en-US/main.ftl index 2a2471ee..7bca890e 100644 --- a/noita-proxy/assets/lang/en-US/main.ftl +++ b/noita-proxy/assets/lang/en-US/main.ftl @@ -100,6 +100,7 @@ Health-percent-lost-on-reviving = Percent of Max HP lost on reviving global_hp_loss = Lose HP globally no_material_damage = No material damage perma_death = Perma death +physics_damage = Physics damage shared_health_desc_1 = Health is shared, but scales with player count. shared_health_desc_2 = Percentage-based damage and full heals are adjusted. shared_health_desc_3 = The original mode. diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 07336ac9..17fd6d44 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -89,6 +89,7 @@ pub struct GameSettings { global_hp_loss: Option, perk_ban_list: Option, perma_death: Option, + physics_damage: Option, } pub struct DefaultSettings { @@ -112,6 +113,7 @@ pub struct DefaultSettings { global_hp_loss: bool, perk_ban_list: String, perma_death: bool, + physics_damage: bool, } impl Default for DefaultSettings { @@ -136,7 +138,8 @@ impl Default for DefaultSettings { no_material_damage: false, global_hp_loss: false, perk_ban_list: "GLOBAL_GORE,GLASS_CANNON,REVENGE_RATS,PLAGUE_RATS,VOMIT_RATS,CORDYCEPS,MOLD,FUNGAL_DISEASE,HOMUNCULUS,LUKKI_MINION".to_string(), - perma_death: false + perma_death: false, + physics_damage: true, } } } @@ -815,6 +818,16 @@ impl App { game_settings.perma_death = Some(temp) } } + ui.add_space(1.0); + { + let mut temp = game_settings.physics_damage.unwrap_or(def.physics_damage); + if ui.checkbox( + &mut temp, + tr("physics_damage"), + ).changed() { + game_settings.physics_damage = Some(temp) + } + } } } }); diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index 4c9fe929..3bb82e9b 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -553,6 +553,10 @@ impl NetManager { "perma_death", settings.perma_death.unwrap_or(def.perma_death), ); + state.try_ws_write_option( + "physics_damage", + settings.physics_damage.unwrap_or(def.physics_damage), + ); let lst = settings.clone(); state.try_ws_write_option( "perk_ban_list", diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index f4a972a3..87bfea92 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -239,6 +239,10 @@ local function player_died() end local ent = LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/local_health/notplayer/poly_effect.xml") ctx.my_player.entity = ent + 1 + if ctx.proxy_opt.physics_damage then + local damage = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent") + ComponentSetValue2(damage, "physics_objects_damage", true) + end do_switch_effect(false) EntitySetName(ctx.my_player.entity, ctx.my_id.."?") util.set_ent_health(ctx.my_player.entity, {max_hp, max_hp})