add physics damage option for notplayer enabled by default

This commit is contained in:
bgkillas 2024-11-13 20:40:23 -05:00
parent 06b61957bc
commit 85c2b3cfc1
4 changed files with 23 additions and 1 deletions

View file

@ -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.

View file

@ -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)
}
}
}
}
});

View file

@ -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",