mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
add physics damage option for notplayer enabled by default
This commit is contained in:
parent
06b61957bc
commit
85c2b3cfc1
4 changed files with 23 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -89,6 +89,7 @@ pub struct GameSettings {
|
|||
global_hp_loss: Option<bool>,
|
||||
perk_ban_list: Option<String>,
|
||||
perma_death: Option<bool>,
|
||||
physics_damage: Option<bool>,
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue