add an (untested) perk ban list

This commit is contained in:
bgkillas 2024-11-02 17:33:15 -04:00
parent 1c967e5ce7
commit ab76f5329d
4 changed files with 14 additions and 2 deletions

View file

@ -87,6 +87,7 @@ pub struct GameSettings {
health_lost_on_revive: u32,
no_material_damage: bool,
global_hp_loss: bool,
perk_ban_list: String,
}
impl Default for GameSettings {
@ -113,6 +114,7 @@ impl Default for GameSettings {
health_lost_on_revive: 0,
no_material_damage: false,
global_hp_loss: false,
perk_ban_list: String::new(),
}
}
}
@ -802,6 +804,10 @@ impl App {
&mut game_settings.randomize_perks,
tr("Have-perk-pools-be-independent-of-each-other"),
);
ui.horizontal(|ui| {
ui.text_edit_singleline(&mut game_settings.perk_ban_list);
ui.label("perk ban list, comma seperated");
});
ui.add(
Slider::new(&mut game_settings.enemy_hp_mult, 1.0..=1000.0)
.logarithmic(true)

View file

@ -503,6 +503,7 @@ impl NetManager {
state.try_ws_write_option("health_per_player", settings.health_per_player);
state.try_ws_write_option("enemy_sync_interval", settings.enemy_sync_interval);
state.try_ws_write_option("global_hp_loss", settings.global_hp_loss);
state.try_ws_write_option("perk_ban_list", settings.perk_ban_list.as_str());
state.try_ws_write_option("no_material_damage", settings.no_material_damage);
state.try_ws_write_option("health_lost_on_revive", settings.health_lost_on_revive);
let rgb = self.init_settings.player_color.player_main;

View file

@ -183,10 +183,11 @@ end
function net_handling.proxy.end_run(_, _)
local entity = ctx.my_player.entity
if entity ~= nil and EntityGetIsAlive(entity) and not EntityHasTag(entity,"ew_notplayer") then
if entity ~= nil and EntityGetIsAlive(entity) and not EntityHasTag(entity, "ew_notplayer") then
EntityInflictDamage(entity, 1000000, "DAMAGE_CURSE", "Run Ended", "NONE", 0, 0, GameGetWorldStateEntity())
end
ctx.run_ended = true
EntityKill(entity)
GameTriggerGameOver()
end

View file

@ -35,4 +35,8 @@ patch_perk_2("LEGGY_FEET", function(entity_perk_item, entity_who_picked, item_na
GameRemoveFlagRun("ATTACK_FOOT_CLIMBER")
end
orig_fn(entity_perk_item, entity_who_picked, item_name, pickup_count)
end)
end)
for _, perk in ipairs(util.string_split(ctx.proxy_opt.perk_ban_list)) do
hide_perk(perk)
end