diff --git a/locale/en/rpg.cfg b/locale/en/rpg.cfg index a4596811..532bf2c7 100644 --- a/locale/en/rpg.cfg +++ b/locale/en/rpg.cfg @@ -102,7 +102,7 @@ flameboots_tooltip=When the bullets simply don´t bite. explosive_bullets_label=Enable explosive bullets? explosive_bullets_tooltip=Hurts the biters a bit extra magic_label=Enable spawning with fish? -magic_label_custom=Enable casting spells with __CONTROL__mtn-ctrl-cast-spell__? +magic_label_custom=Enable casting spells with __CONTROL__mtn-shift-cast-spell__? toggle_cast_spell_label=Toggles the ability to cast spells. cast_spell_enabled_label=Casting spells with fish has been enabled! cast_spell_disabled_label=Casting spells with fish has been disabled! diff --git a/maps/mountain_fortress_v3/functions.lua b/maps/mountain_fortress_v3/functions.lua index 319a2ec0..1978129c 100644 --- a/maps/mountain_fortress_v3/functions.lua +++ b/maps/mountain_fortress_v3/functions.lua @@ -167,7 +167,7 @@ local function draw_notice_frame(player) label_flow.style.top_padding = 10 label_flow.style.left_padding = 24 - local info_message = '[font=heading-1]Work in progress - balance not guaranteed[/font]\n\nPlease note that this experience is a work in progress, and the gameplay balance may vary significantly.\nSome features are still being fine-tuned, so expect occasional bugs or unbalanced elements.\nYour feedback is welcome at our discord in #mount-fortress.\n\nEnjoy and explore, but proceed with caution! ☺\n\n/Gerkiz' + local info_message = '[font=heading-1]Work in progress - balance not guaranteed[/font]\n\nPlease note that this experience is a work in progress, and the gameplay balance may vary significantly.\nSome features are still being fine-tuned, so expect occasional bugs or unbalanced elements.\nPlease post your feedbacks in #mount-fortress.\n\nEnjoy and explore, but proceed with caution! ☺\n\n/Gerkiz' label_flow.style.horizontally_stretchable = false local label = label_flow.add { type = 'label', caption = info_message } @@ -741,27 +741,68 @@ local set_worm_raffle_token = Task.register( function (event) local level = event.level - WD.set( - 'worm_raffle', - { - ['small-worm-turret'] = round(1000 - level * 1.75, 6), - ['medium-worm-turret'] = round(level, 6), - ['big-worm-turret'] = 0, - ['behemoth-worm-turret'] = 0 - } - ) - local worm_raffle = WD.get('worm_raffle') --[[@as table]] - - if level > 500 then - worm_raffle['medium-worm-turret'] = round(500 - (level - 500), 6) - worm_raffle['big-worm-turret'] = round((level - 500) * 2, 6) - end - if level > 800 then - worm_raffle['behemoth-worm-turret'] = round((level - 800) * 3, 6) - end - for k, _ in pairs(worm_raffle) do - if worm_raffle[k] < 0 then - worm_raffle[k] = 0 + if not is_modded then + WD.set( + 'worm_raffle', + { + ['small-worm-turret'] = round(1000 - level * 1.75, 6), + ['medium-worm-turret'] = round(level, 6), + ['big-worm-turret'] = 0, + ['behemoth-worm-turret'] = 0 + } + ) + local worm_raffle = WD.get('worm_raffle') --[[@as table]] + + if level > 500 then + worm_raffle['medium-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['big-worm-turret'] = round((level - 500) * 2, 6) + end + if level > 800 then + worm_raffle['behemoth-worm-turret'] = round((level - 800) * 3, 6) + end + for k, _ in pairs(worm_raffle) do + if worm_raffle[k] < 0 then + worm_raffle[k] = 0 + end + end + else + WD.set( + 'worm_raffle', + { + ['small-worm-turret'] = round(1000 - level * 1.75, 6), + ['mtn-addon-small-explosive-worm-turret'] = round(1000 - level * 1.75, 6), + ['mtn-addon-small-fire-worm-turret'] = round(1000 - level * 1.75, 6), + ['mtn-addon-small-piercing-worm-turret'] = round(1000 - level * 1.75, 6), + ['mtn-addon-small-poison-worm-turret'] = round(1000 - level * 1.75, 6), + ['mtn-addon-small-electric-worm-turret'] = round(1000 - level * 1.75, 6), + ['medium-worm-turret'] = round(level, 6), + ['big-worm-turret'] = 0, + ['behemoth-worm-turret'] = 0 + } + ) + local worm_raffle = WD.get('worm_raffle') --[[@as table]] + + if level > 500 then + worm_raffle['mtn-addon-medium-explosive-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['mtn-addon-medium-fire-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['mtn-addon-medium-piercing-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['mtn-addon-medium-poison-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['mtn-addon-medium-electric-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['medium-worm-turret'] = round(500 - (level - 500), 6) + worm_raffle['big-worm-turret'] = round((level - 500) * 2, 6) + end + if level > 800 then + worm_raffle['mtn-addon-big-explosive-worm-turret'] = round((level - 800) * 3, 6) + worm_raffle['mtn-addon-big-fire-worm-turret'] = round((level - 800) * 3, 6) + worm_raffle['mtn-addon-big-piercing-worm-turret'] = round((level - 800) * 3, 6) + worm_raffle['mtn-addon-big-poison-worm-turret'] = round((level - 800) * 3, 6) + worm_raffle['mtn-addon-big-electric-worm-turret'] = round((level - 800) * 3, 6) + worm_raffle['behemoth-worm-turret'] = round((level - 800) * 3, 6) + end + for k, _ in pairs(worm_raffle) do + if worm_raffle[k] < 0 then + worm_raffle[k] = 0 + end end end end @@ -2126,6 +2167,7 @@ function Public.on_player_joined_game(event) local players = Public.get('players') local player = game.players[event.player_index] + Difficulty.clear_top_frame(player) Modifiers.update_player_modifiers(player) local active_surface_index = Public.get('active_surface_index') @@ -2156,6 +2198,10 @@ function Public.on_player_joined_game(event) Alert.alert_player(player, 15, death_message) end player.clear_items_inside() + if Public.is_modded then + draw_notice_frame(player) + end + for item, data in pairs(this.starting_items) do player.insert({ name = item, count = data.count }) end diff --git a/modules/autostash.lua b/modules/autostash.lua index 7e8c47ae..5b462097 100644 --- a/modules/autostash.lua +++ b/modules/autostash.lua @@ -809,14 +809,14 @@ Gui.on_click( ) if script.active_mods['MtnFortressAddons'] then - Event.add("mtn-ctrl-autostash-all", function (event) - local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click') - if is_spamming then + Event.add("mtn-shift-autostash-all", function (event) + local player = game.get_player(event.player_index) + if not player or not player.valid then return end - local player = game.get_player(event.player_index) - if not player or not player.valid then + local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click') + if is_spamming then return end @@ -835,14 +835,14 @@ if script.active_mods['MtnFortressAddons'] then auto_stash(player, event) end) - Event.add("mtn-ctrl-autostash-ores", function (event) - local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click') - if is_spamming then + Event.add("mtn-shift-autostash-ores", function (event) + local player = game.get_player(event.player_index) + if not player or not player.valid then return end - local player = game.get_player(event.player_index) - if not player or not player.valid then + local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click') + if is_spamming then return end @@ -861,14 +861,14 @@ if script.active_mods['MtnFortressAddons'] then auto_stash(player, event) end) - Event.add("mtn-ctrl-autostash-furnaces", function (event) - local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click') - if is_spamming then + Event.add("mtn-shift-autostash-furnaces", function (event) + local player = game.get_player(event.player_index) + if not player or not player.valid then return end - local player = game.get_player(event.player_index) - if not player or not player.valid then + local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click') + if is_spamming then return end @@ -888,14 +888,14 @@ if script.active_mods['MtnFortressAddons'] then auto_stash(player, event) end) - Event.add("mtn-ctrl-autostash-filtered", function (event) - local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click') - if is_spamming then + Event.add("mtn-shift-autostash-filtered", function (event) + local player = game.get_player(event.player_index) + if not player or not player.valid then return end - local player = game.get_player(event.player_index) - if not player or not player.valid then + local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click') + if is_spamming then return end @@ -915,14 +915,14 @@ if script.active_mods['MtnFortressAddons'] then auto_stash(player, event) end) - Event.add("mtn-ctrl-autostash-wagon", function (event) - local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click') - if is_spamming then + Event.add("mtn-shift-autostash-wagon", function (event) + local player = game.get_player(event.player_index) + if not player or not player.valid then return end - local player = game.get_player(event.player_index) - if not player or not player.valid then + local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click') + if is_spamming then return end diff --git a/modules/rpg/main.lua b/modules/rpg/main.lua index 4b6aff79..9d99ce3f 100644 --- a/modules/rpg/main.lua +++ b/modules/rpg/main.lua @@ -1267,7 +1267,7 @@ Event.add(defines.events.on_player_respawned, on_player_respawned) Event.add(defines.events.on_player_rotated_entity, on_player_rotated_entity) Event.add(defines.events.on_pre_player_mined_item, on_pre_player_mined_item) if script.active_mods['MtnFortressAddons'] then - Event.add('mtn-ctrl-cast-spell', on_player_used_capsule_custom) + Event.add('mtn-shift-cast-spell', on_player_used_capsule_custom) end Event.add(defines.events.on_player_used_capsule, on_player_used_capsule) Event.add(defines.events.on_player_changed_surface, on_player_changed_surface)