mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-29 21:47:08 +02:00
Mtn v3 - minor changes
This commit is contained in:
parent
9b110033e2
commit
70dad1053d
@ -716,7 +716,7 @@ function Public.save_car(event)
|
|||||||
|
|
||||||
log_err('Owner of this vehicle is: ' .. p.name)
|
log_err('Owner of this vehicle is: ' .. p.name)
|
||||||
save_surface(entity, p)
|
save_surface(entity, p)
|
||||||
Utils.action_warning(module_tag .. player.name .. ' has looted ' .. p.name .. '´s car.')
|
game.print(module_tag .. player.name .. ' has looted ' .. p.name .. '´s car.')
|
||||||
player.print(module_tag .. 'This car was not yours to keep.', Color.warning)
|
player.print(module_tag .. 'This car was not yours to keep.', Color.warning)
|
||||||
local params = {
|
local params = {
|
||||||
player = player,
|
player = player,
|
||||||
@ -978,7 +978,9 @@ function Public.validate_owner(player, entity)
|
|||||||
if car.owner ~= player.index and player.driving then
|
if car.owner ~= player.index and player.driving then
|
||||||
player.driving = false
|
player.driving = false
|
||||||
if not player.admin then
|
if not player.admin then
|
||||||
return p.print(player.name .. ' tried to drive your car.', Color.warning)
|
p.print(player.name .. ' tried to drive your car.', Color.warning)
|
||||||
|
Utils.action_notify_admins(player.name .. ' tried to drive ' .. p.name .. '´s car.')
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -996,33 +996,57 @@ local function update_raw()
|
|||||||
elseif collection.survive_for and collection.survive_for < 0 then
|
elseif collection.survive_for and collection.survive_for < 0 then
|
||||||
collection.survive_for = 0
|
collection.survive_for = 0
|
||||||
if collection.game_won and not collection.game_won_notified then
|
if collection.game_won and not collection.game_won_notified then
|
||||||
|
game.print('[color=yellow][Mtn v3][/color] Game won!')
|
||||||
|
collection.game_won = true
|
||||||
|
stateful.collection.time_until_attack = 0
|
||||||
|
stateful.collection.time_until_attack_timer = 0
|
||||||
|
stateful.collection.gather_time = 0
|
||||||
|
stateful.collection.gather_time_timer = 0
|
||||||
|
collection.survive_for = 0
|
||||||
|
collection.survive_for_timer = 0
|
||||||
|
refresh_frames()
|
||||||
|
|
||||||
|
local reversed = Public.get_stateful_settings('reversed')
|
||||||
|
if reversed then
|
||||||
|
Public.set_stateful_settings('reversed', false)
|
||||||
|
else
|
||||||
|
Public.set_stateful_settings('reversed', true)
|
||||||
|
end
|
||||||
|
|
||||||
collection.game_won_notified = true
|
collection.game_won_notified = true
|
||||||
refresh_boss_frame()
|
refresh_boss_frame()
|
||||||
play_game_won()
|
play_game_won()
|
||||||
|
WD.disable_spawning_biters(true)
|
||||||
|
Collapse.disable_collapse(true)
|
||||||
|
WD.nuke_wave_gui()
|
||||||
Server.to_discord_embed('Game won!')
|
Server.to_discord_embed('Game won!')
|
||||||
stateful.rounds_survived = stateful.rounds_survived + 1
|
stateful.rounds_survived = stateful.rounds_survived + 1
|
||||||
|
stateful.selected_objectives = nil
|
||||||
local buff = Stateful.save_settings()
|
local buff = Stateful.save_settings()
|
||||||
notify_won_to_discord(buff)
|
notify_won_to_discord(buff)
|
||||||
local locomotive = Public.get('locomotive')
|
local locomotive = Public.get('locomotive')
|
||||||
if locomotive and locomotive.valid then
|
if locomotive and locomotive.valid then
|
||||||
locomotive.surface.spill_item_stack(locomotive.position, {name = 'coin', count = 512}, false)
|
locomotive.surface.spill_item_stack(locomotive.position, {name = 'coin', count = 512}, false)
|
||||||
Public.set('game_reset_tick', 5400)
|
|
||||||
end
|
end
|
||||||
|
Public.set('game_reset_tick', 5400)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for objective_index = 1, #stateful.selected_objectives do
|
if stateful.selected_objectives and next(stateful.selected_objectives) then
|
||||||
local objective = stateful.selected_objectives[objective_index]
|
for objective_index = 1, #stateful.selected_objectives do
|
||||||
local objective_name = objective.name
|
local objective = stateful.selected_objectives[objective_index]
|
||||||
local callback = Task.get(objective.token)
|
local objective_name = objective.name
|
||||||
local completed, _, _ = callback()
|
local callback = Task.get(objective.token)
|
||||||
if completed and completed == true and not stateful.objectives_completed[objective_name] then
|
local completed, _, _ = callback()
|
||||||
stateful.objectives_completed[objective_name] = true
|
if completed and completed == true and not stateful.objectives_completed[objective_name] then
|
||||||
Alert.alert_all_players(10, 'Objective: **' .. objective_name .. '** has been completed!')
|
stateful.objectives_completed[objective_name] = true
|
||||||
Server.to_discord_embed('Objective: **' .. objective_name .. '** has been completed!')
|
Alert.alert_all_players(10, 'Objective: **' .. objective_name .. '** has been completed!')
|
||||||
play_achievement_unlocked()
|
Server.to_discord_embed('Objective: **' .. objective_name .. '** has been completed!')
|
||||||
stateful.objectives_completed_count = stateful.objectives_completed_count + 1
|
play_achievement_unlocked()
|
||||||
|
stateful.objectives_completed_count = stateful.objectives_completed_count + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1058,6 +1082,7 @@ local function update_raw()
|
|||||||
WD.nuke_wave_gui()
|
WD.nuke_wave_gui()
|
||||||
Server.to_discord_embed('Game won!')
|
Server.to_discord_embed('Game won!')
|
||||||
stateful.rounds_survived = stateful.rounds_survived + 1
|
stateful.rounds_survived = stateful.rounds_survived + 1
|
||||||
|
stateful.selected_objectives = nil
|
||||||
local buff = Stateful.save_settings()
|
local buff = Stateful.save_settings()
|
||||||
notify_won_to_discord(buff)
|
notify_won_to_discord(buff)
|
||||||
local locomotive = Public.get('locomotive')
|
local locomotive = Public.get('locomotive')
|
||||||
@ -1070,6 +1095,7 @@ local function update_raw()
|
|||||||
|
|
||||||
stateful.collection.gather_time = tick + 54000
|
stateful.collection.gather_time = tick + 54000
|
||||||
stateful.collection.gather_time_timer = tick + 54000
|
stateful.collection.gather_time_timer = tick + 54000
|
||||||
|
game.forces.enemy.evolution_factor = 1
|
||||||
play_achievement_unlocked()
|
play_achievement_unlocked()
|
||||||
WD.disable_spawning_biters(true)
|
WD.disable_spawning_biters(true)
|
||||||
Collapse.disable_collapse(true)
|
Collapse.disable_collapse(true)
|
||||||
|
@ -317,6 +317,17 @@ function Public.action_warning(warning_prefixes, msg)
|
|||||||
Server.to_discord_bold(msg)
|
Server.to_discord_bold(msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Takes msg and prints it to all admin players
|
||||||
|
-- @param msg <string> The message to print
|
||||||
|
function Public.action_notify_admins(msg)
|
||||||
|
for _, p in pairs(game.connected_players) do
|
||||||
|
if p.admin then
|
||||||
|
p.print(msg, Color.yellow)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
print(msg)
|
||||||
|
end
|
||||||
|
|
||||||
--- Takes msg and prints it to all players. Also prints to the log and discord
|
--- Takes msg and prints it to all players. Also prints to the log and discord
|
||||||
-- @param msg <string> The message to print
|
-- @param msg <string> The message to print
|
||||||
-- @param warning_prefixes <string> The name of the module/warning
|
-- @param warning_prefixes <string> The name of the module/warning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user