mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Allow scaling enemy health. Closes #71
This commit is contained in:
parent
b25f2b0c41
commit
a580c7045d
8 changed files with 28 additions and 4 deletions
2
Justfile
2
Justfile
|
@ -19,7 +19,7 @@ run2:
|
||||||
run3:
|
run3:
|
||||||
cd noita-proxy && NP_APPID=480 NP_SKIP_MOD_CHECK=1 NP_NOITA_ADDR=127.0.0.1:21253 cargo run -- --launch-cmd "wine noita.exe -gamemode 0"
|
cd noita-proxy && NP_APPID=480 NP_SKIP_MOD_CHECK=1 NP_NOITA_ADDR=127.0.0.1:21253 cargo run -- --launch-cmd "wine noita.exe -gamemode 0"
|
||||||
|
|
||||||
release:
|
release: build
|
||||||
python prepare_release.py
|
python prepare_release.py
|
||||||
|
|
||||||
noita:
|
noita:
|
||||||
|
|
|
@ -17,6 +17,7 @@ connect_settings_player_tether = Player tether enabled
|
||||||
connect_settings_player_tether_desc = Player tether: Teleports clients to host if they get far enough.
|
connect_settings_player_tether_desc = Player tether: Teleports clients to host if they get far enough.
|
||||||
connect_settings_player_tether_length = Tether length
|
connect_settings_player_tether_length = Tether length
|
||||||
connect_settings_item_dedup = Deduplicate (sync) items spawned by world generation.
|
connect_settings_item_dedup = Deduplicate (sync) items spawned by world generation.
|
||||||
|
connect_settings_enemy_hp_scale = Enemy hp scale.
|
||||||
connect_settings_local = Local settings
|
connect_settings_local = Local settings
|
||||||
connect_settings_autostart = Start the game automatically
|
connect_settings_autostart = Start the game automatically
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ pub struct GameSettings {
|
||||||
tether_length: u32,
|
tether_length: u32,
|
||||||
use_constant_seed: bool,
|
use_constant_seed: bool,
|
||||||
item_dedup: bool,
|
item_dedup: bool,
|
||||||
|
enemy_hp_mult: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for GameSettings {
|
impl Default for GameSettings {
|
||||||
|
@ -53,6 +54,7 @@ impl Default for GameSettings {
|
||||||
tether_length: 750,
|
tether_length: 750,
|
||||||
use_constant_seed: false,
|
use_constant_seed: false,
|
||||||
item_dedup: true,
|
item_dedup: true,
|
||||||
|
enemy_hp_mult: 1.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -423,7 +425,10 @@ impl App {
|
||||||
Slider::new(&mut self.saved_state.game_settings.tether_length, 10..=5000)
|
Slider::new(&mut self.saved_state.game_settings.tether_length, 10..=5000)
|
||||||
.text(tr("connect_settings_player_tether_length")),
|
.text(tr("connect_settings_player_tether_length")),
|
||||||
);
|
);
|
||||||
|
ui.add_space(20.0);
|
||||||
ui.checkbox(&mut self.saved_state.game_settings.item_dedup, tr("connect_settings_item_dedup"));
|
ui.checkbox(&mut self.saved_state.game_settings.item_dedup, tr("connect_settings_item_dedup"));
|
||||||
|
ui.add_space(20.0);
|
||||||
|
ui.add(Slider::new(&mut self.saved_state.game_settings.enemy_hp_mult, 1.0..=1000.0).logarithmic(true).text(tr("connect_settings_enemy_hp_scale")));
|
||||||
|
|
||||||
heading_with_underline(ui, tr("connect_settings_local"));
|
heading_with_underline(ui, tr("connect_settings_local"));
|
||||||
ui.checkbox(
|
ui.checkbox(
|
||||||
|
|
|
@ -287,6 +287,7 @@ impl NetManager {
|
||||||
state.try_ws_write_option("player_tether", settings.player_tether);
|
state.try_ws_write_option("player_tether", settings.player_tether);
|
||||||
state.try_ws_write_option("tether_length", settings.tether_length);
|
state.try_ws_write_option("tether_length", settings.tether_length);
|
||||||
state.try_ws_write_option("item_dedup", settings.item_dedup);
|
state.try_ws_write_option("item_dedup", settings.item_dedup);
|
||||||
|
state.try_ws_write_option("enemy_hp_scale", settings.enemy_hp_mult);
|
||||||
|
|
||||||
state.try_ws_write(ws_encode_proxy("ready", ""));
|
state.try_ws_write(ws_encode_proxy("ready", ""));
|
||||||
// TODO? those are currently ignored by mod
|
// TODO? those are currently ignored by mod
|
||||||
|
|
|
@ -23,6 +23,12 @@ impl ProxyOpt for u32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ProxyOpt for f32 {
|
||||||
|
fn write_opt(self, buf: &mut Vec<u8>, key: &str) {
|
||||||
|
write!(buf, "proxy_opt_num {} {}", key, self).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ProxyOpt for &str {
|
impl ProxyOpt for &str {
|
||||||
fn write_opt(self, buf: &mut Vec<u8>, key: &str) {
|
fn write_opt(self, buf: &mut Vec<u8>, key: &str) {
|
||||||
write!(buf, "proxy_opt {} {}", key, self).unwrap();
|
write!(buf, "proxy_opt {} {}", key, self).unwrap();
|
||||||
|
|
10
quant.ew/files/src/system/enemy_scaling/enemy_scaling.lua
Normal file
10
quant.ew/files/src/system/enemy_scaling/enemy_scaling.lua
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
local ctx = dofile_once("mods/quant.ew/files/src/ctx.lua")
|
||||||
|
local hp_scale = ctx.proxy_opt.enemy_hp_scale
|
||||||
|
|
||||||
|
if hp_scale > 1.01 then
|
||||||
|
SessionNumbersSetValue( "DESIGN_SCALE_ENEMIES", "1" )
|
||||||
|
SessionNumbersSetValue( "DESIGN_NEW_GAME_PLUS_HP_SCALE_MIN", hp_scale )
|
||||||
|
SessionNumbersSetValue( "DESIGN_NEW_GAME_PLUS_HP_SCALE_MAX", hp_scale )
|
||||||
|
end
|
||||||
|
|
||||||
|
return {}
|
|
@ -40,10 +40,10 @@ np.CrossCallAdd("ew_spawn_hook_pre", function(ent_path, x, y)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Called after entity was loaded.
|
||||||
|
-- Might be useless in some cases, as entity was already despawned/serialized due to CameraBoundComponent.
|
||||||
np.CrossCallAdd("ew_spawn_hook_post", function(ent_path, ent)
|
np.CrossCallAdd("ew_spawn_hook_post", function(ent_path, ent)
|
||||||
-- if not EntityHasTag(ent, "enemy") then
|
|
||||||
-- EntityAddTag(ent, "ew_enemy_sync_extra")
|
|
||||||
-- end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local entity_is_enemy_cache = {}
|
local entity_is_enemy_cache = {}
|
||||||
|
|
|
@ -61,6 +61,7 @@ local function load_modules()
|
||||||
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/kolmi/kolmi.lua")
|
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/kolmi/kolmi.lua")
|
||||||
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/ending/ending.lua")
|
ctx.dofile_and_add_hooks("mods/quant.ew/files/src/system/ending/ending.lua")
|
||||||
ctx.load_system("spell_patches")
|
ctx.load_system("spell_patches")
|
||||||
|
ctx.load_system("enemy_scaling")
|
||||||
end
|
end
|
||||||
|
|
||||||
function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, position_y, target_x, target_y, send_message,
|
function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, position_y, target_x, target_y, send_message,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue