1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-26 03:52:22 +02:00

mtn v3 - more difficulty fixes

This commit is contained in:
Gerkiz 2022-07-10 21:53:18 +02:00
parent 2f54542c2f
commit e12bf74822
5 changed files with 77 additions and 1 deletions

View File

@ -22,7 +22,7 @@ treasure_rare_1=[color=blue]Mapkeeper:[/color] Your magic improves. You have fou
treasure_rare_2=[color=blue]Mapkeeper:[/color] Oh how wonderful. You found a chest underneath the broken rocks. It's filled with rare goodies!
treasure_rare_3=[color=blue]Mapkeeper:[/color] You're a wizard! We have found the rare precious!
defeated_1=[color=blue]Mapkeeper:[/color]\nOh no, the biters nom'ed the train away!\nBetter luck next time.
defeated_2=[color=blue]Mapkeeper:[/color]\nI'm not 100% sure, but - apparently the train was chewed away.\nBetter luck next time.
defeated_2=[color=blue]Mapkeeper:[/color]\nApparently the train was chewed away.\nBetter luck next time.
defeated_3=[color=blue]Mapkeeper:[/color]\nYou had one objective - defend the train *-*\nBetter luck next time.
defeated_4=[color=blue]Mapkeeper:[/color]\nLooks like we're resetting cause you did not defend the train ._.\nBetter luck next time.
reset_game=*** Soft-reset is disabled! Server will restart from scenario to load new changes. ***

View File

@ -156,6 +156,40 @@ commands.add_command(
end
)
commands.add_command(
'toggle_orbital_strikes',
'Usable only for admins - toggles orbital strikes!',
function()
local player = game.player
if not player and player.valid then
return
end
if not player.admin then
player.print("[ERROR] You're not admin!", Color.fail)
return
end
local this = WPT.get()
if not this.orbital_strikes_are_you_sure then
this.orbital_strikes_are_you_sure = true
player.print('[WARNING] This command will disable the orbital_strikes in-game, run this command again if you really want to do this!', Color.warning)
return
end
if this.orbital_strikes.enabled then
game.print(mapkeeper .. ' ' .. player.name .. ', has disabled the orbital_strikes module!', {r = 0.98, g = 0.66, b = 0.22})
this.orbital_strikes.enabled = false
else
game.print(mapkeeper .. ' ' .. player.name .. ', has enabled the orbital_strikes module!', {r = 0.98, g = 0.66, b = 0.22})
this.orbital_strikes.enabled = true
end
this.orbital_strikes_are_you_sure = nil
end
)
commands.add_command(
'get_queue_speed',
'Usable only for admins - gets the queue speed of this map!',

View File

@ -14,6 +14,7 @@ local ICW_Func = require 'maps.mountain_fortress_v3.icw.functions'
local math2d = require 'math2d'
local Misc = require 'utils.commands.misc'
local Core = require 'utils.core'
local Beams = require 'modules.render_beam'
local zone_settings = WPT.zone_settings
local this = {
@ -306,6 +307,36 @@ local function difficulty_and_adjust_prices()
end
end
local function do_beams_away()
local wave_number = WD.get_wave()
local orbital_strikes = WPT.get('orbital_strikes')
if not orbital_strikes.enabled then
return
end
if wave_number > 1000 then
local difficulty_index = Difficulty.get('index')
local wave_nth = 9999
if difficulty_index == 1 then
wave_nth = 1000
elseif difficulty_index == 2 then
wave_nth = 500
elseif difficulty_index == 3 then
wave_nth = 250
end
if wave_number % wave_nth == 0 then
local active_surface_index = WPT.get('active_surface_index')
local surface = game.get_surface(active_surface_index)
if not orbital_strikes[wave_number] then
orbital_strikes[wave_number] = true
Beams.new_beam_delayed(surface, random(500, 3000))
end
end
end
end
local function do_artillery_turrets_targets()
local art_table = this.art_table
local index = art_table.index
@ -393,6 +424,7 @@ local function tick()
do_magic_crafters()
do_magic_fluid_crafters()
do_artillery_turrets_targets()
do_beams_away()
end
Public.deactivate_callback =

View File

@ -152,6 +152,9 @@ function Public.reset_table()
pickaxe_tier = 1,
chests_outside_upgrades = 1
}
this.orbital_strikes = {
enabled = true
}
this.pickaxe_speed_per_purchase = 0.07
this.breached_wall = 1
this.left_top = {

View File

@ -29,6 +29,13 @@ commands.add_command(
return Public.spawn_unit_group(true, true)
end
if param == 'set_wave_1500' then
for _ = 1, 1500 do
Public.set_next_wave()
end
return Public.spawn_unit_group(true, true)
end
if param == 'log_all' then
return Public.toggle_debug()
end