diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 8e399ae9..29a5e1ec 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -79,7 +79,7 @@ pub struct GameSettings { world_num: u16, debug_mode: Option, use_constant_seed: bool, - // item_dedup: Option, TODO + duplicate: Option, enemy_hp_mult: Option, game_mode: Option, friendly_fire: Option, @@ -236,15 +236,15 @@ impl GameSettings { ui.add(DragValue::new(&mut game_settings.seed)); } }); - /*{ - let mut temp = game_settings.item_dedup.unwrap_or(def.item_dedup); + { + let mut temp = game_settings.duplicate.unwrap_or(def.duplicate); if ui - .checkbox(&mut temp, tr("connect_settings_item_dedup")) + .checkbox(&mut temp, "duplicate synced entities") .changed() { - game_settings.item_dedup = Some(temp) + game_settings.duplicate = Some(temp) } - }TODO*/ + } { let mut temp = game_settings .nice_terraforming @@ -355,6 +355,7 @@ pub struct DefaultSettings { share_gold: bool, nice_terraforming: bool, same_loadout: bool, + duplicate: bool, } impl Default for DefaultSettings { @@ -378,6 +379,7 @@ impl Default for DefaultSettings { share_gold: false, nice_terraforming: true, same_loadout: false, + duplicate: false, } } } diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index 2e758ccc..6c4d9ac6 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -641,6 +641,7 @@ impl NetManager { ); state.try_ws_write_option("debug", settings.debug_mode.unwrap_or(def.debug_mode)); // state.try_ws_write_option("item_dedup", settings.item_dedup.unwrap_or(def.item_dedup)); TODO + state.try_ws_write_option("duplicate", settings.duplicate.unwrap_or(def.duplicate)); state.try_ws_write_option( "randomize_perks", settings.randomize_perks.unwrap_or(def.randomize_perks), diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index 7ec2fb49..4baeb9c3 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -769,4 +769,4 @@ function rpc.switch_effect(x, y, to_normal_player) end end -return module \ No newline at end of file +return module diff --git a/quant.ew/files/system/stevari/stevari.lua b/quant.ew/files/system/stevari/stevari.lua index a7f5819b..523dc332 100644 --- a/quant.ew/files/system/stevari/stevari.lua +++ b/quant.ew/files/system/stevari/stevari.lua @@ -32,14 +32,14 @@ function rpc.request_flag_slow(x, y) local flag = "ew_spawn_stevari" .. ":" .. math.floor(x / 512) .. ":" .. math.floor(y / 512) local res = GameHasFlagRun(flag) GameAddFlagRun(flag) - rpc.got_flag_slow(ctx.rpc_peer_id, res, x, y) + rpc.got_flag_slow(ctx.rpc_peer_id, not res or ctx.proxy_opt.duplicate, x, y) end end rpc.opts_reliable() rpc.opts_everywhere() function rpc.got_flag_slow(peer_id, state, x, y) - if peer_id == ctx.my_id and not state then + if peer_id == ctx.my_id and state then rpc.spawn_stevari(x, y) end end diff --git a/quant.ew/files/system/uniq_flags/uniq_flags.lua b/quant.ew/files/system/uniq_flags/uniq_flags.lua index 56974440..6058e809 100644 --- a/quant.ew/files/system/uniq_flags/uniq_flags.lua +++ b/quant.ew/files/system/uniq_flags/uniq_flags.lua @@ -9,7 +9,7 @@ function rpc.request_flag(flag) if ctx.is_host then local res = GameHasFlagRun(flag) GameAddFlagRun(flag) - rpc.got_flag(flag, ctx.rpc_peer_id, not res) + rpc.got_flag(flag, ctx.rpc_peer_id, not res or ctx.proxy_opt.duplicate) end end @@ -42,7 +42,7 @@ function rpc.request_flag_slow(flag, ent) if ctx.is_host then local res = GameHasFlagRun(flag) GameAddFlagRun(flag) - rpc.got_flag_slow(ctx.rpc_peer_id, res, ent) + rpc.got_flag_slow(ctx.rpc_peer_id, not res or ctx.proxy_opt.duplicate, ent) end end @@ -51,9 +51,9 @@ rpc.opts_everywhere() function rpc.got_flag_slow(peer_id, state, ent) if peer_id == ctx.my_id then if state then - EntityKill(ent) - else ewext.track(ent) + else + EntityKill(ent) end end end @@ -114,14 +114,14 @@ function rpc.request_moon_flag_slow(x, y, dark) local flag = "ew_moon_spawn" .. ":" .. math.floor(x / 512) .. ":" .. math.floor(y / 512) local res = GameHasFlagRun(flag) GameAddFlagRun(flag) - rpc.got_flag_moon_slow(ctx.rpc_peer_id, res, x, y, dark) + rpc.got_flag_moon_slow(ctx.rpc_peer_id, not res or ctx.proxy_opt.duplicate, x, y, dark) end end rpc.opts_reliable() rpc.opts_everywhere() function rpc.got_flag_moon_slow(peer_id, state, x, y, dark) - if peer_id == ctx.my_id and not state then + if peer_id == ctx.my_id and state then if dark then EntityLoad("data/entities/items/pickup/sun/newsun_dark.xml", x, y) else diff --git a/quant.ew/files/system/wang_hooks/wang_hooks.lua b/quant.ew/files/system/wang_hooks/wang_hooks.lua index 09d3fd22..0b106b63 100644 --- a/quant.ew/files/system/wang_hooks/wang_hooks.lua +++ b/quant.ew/files/system/wang_hooks/wang_hooks.lua @@ -117,6 +117,7 @@ local allow_patching = { spawn_bones = {}, spawn_barricade = {}, spawn_rock = {}, + spawn_scorpions = {}, } local current_file @@ -242,4 +243,4 @@ end util.add_cross_call("ew_sync_pixel_scene", rpc.sync_pixel_scene) -return module \ No newline at end of file +return module