mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-03 13:12:11 +02:00
Mtn v3 - fix radar scanning
This commit is contained in:
parent
7438b07cce
commit
548747d9df
@ -1,7 +1,7 @@
|
||||
[mountain_fortress_v3]
|
||||
map_info_main_caption=M O U N T A I N F O R T R E S S V3
|
||||
map_info_sub_caption= ~~ diggy diggy choo choo ~~
|
||||
map_info_text=[color=red]READ THIS!\nIf there are any code bugs or desyncs. Please report asap to @Gerkiz!\nIf there are any game breaking bugs then this map might be shutdown to hot-fix the issue.[/color]\n\nThe biters have caught the scent of fish in the cargo wagon.\nGuide the choo into the mountain and protect it as long as possible!\nThis however will not be an easy task,\nsince their strength and numbers increase over time.\n\nIn additon, the southern grounds collapse over time.\n\nDelve deep for greater treasures, but also face increased dangers.\nMining productivity research will overhaul your mining equipment, increasing the size of your backpack.\n\nAs you dig, you will encounter impassable dark chasms or rivers.\nArtillery will try to shoot you down! Dig fast, dig north!\n\nSome explosives may cause rocks to fall down the mountain, filling the void, creating new ways.\nAll they need is a container and a well aimed shot.\n\nEnter the cargo wagon to reveal the wagon surface!\n\nRandom buildings that generate resources can be found throughout the world.\n\nPlacing steel-chests near cargo-wagons enables you to quickly move content.\n\nStaying inside the locomotive aura prevents biters from spawning when mining entities.\n\nRadars do not generate new areas.\n\nRPG GUI is disabled inside the locomotive.\n\nDisconnecting wagons is disabled.\nYou can't cancel crafting when standing inside the locomotive aura.\n\nDon't try to run north with your Spidertron if the train is not near you.\nYou have been warned.\n\nMining drills have great mining-bonus which also is increased after each research, use them when you can!\n\nThe mystical chest in the locomotive offers some rewards.\nOne must feed the chest to receive such rewards.\n\nGood luck on your journey!
|
||||
map_info_text=[color=red]READ THIS!\nIf there are any code bugs or desyncs. Please report asap to @Gerkiz!\nIf there are any game breaking bugs then this map might be shutdown to hot-fix the issue.[/color]\n\nThe biters have caught the scent of fish in the cargo wagon.\nGuide the choo into the mountain and protect it as long as possible!\nThis however will not be an easy task,\nsince their strength and numbers increase over time.\n\nIn additon, the southern grounds collapse over time.\n\nDelve deep for greater treasures, but also face increased dangers.\nMining productivity research will overhaul your mining equipment, increasing the size of your backpack.\n\nAs you dig, you will encounter impassable dark chasms or rivers.\nArtillery will try to shoot you down! Dig fast, dig north!\n\nSome explosives may cause rocks to fall down the mountain, filling the void, creating new ways.\nAll they need is a container and a well aimed shot.\n\nEnter the cargo wagon to reveal the wagon surface!\n\nRandom buildings that generate resources can be found throughout the world.\n\nPlacing steel-chests near cargo-wagons enables you to quickly move content.\n\nStaying inside the locomotive aura prevents biters from spawning when mining entities.\n\nRadars cannot be built near each other.\n\nRPG GUI is disabled inside the locomotive.\n\nDisconnecting wagons is disabled.\nYou can't cancel crafting when standing inside the locomotive aura.\n\nDon't try to run north with your Spidertron if the train is not near you.\nYou have been warned.\n\nMining drills have great mining-bonus which also is increased after each research, use them when you can!\n\nThe mystical chest in the locomotive offers some rewards.\nOne must feed the chest to receive such rewards.\n\nGood luck on your journey!
|
||||
|
||||
[breached_wall]
|
||||
collapse_start=[color=blue]Mapkeeper:[/color]\nWarning, Collapse has begun!
|
||||
@ -31,6 +31,7 @@ notify_shutdown=Soft-reset is disabled! Server will shutdown. Most likely becaus
|
||||
train_taking_damage=[color=blue]Comfylatron:[/color]\nTrain is taking heavy damage.\nDeploying defense mechanisms.
|
||||
entity_limit_reached=__1__ limit reached. Purchase more slots at the market!
|
||||
found_car=__1__ has found a car underneath the rumble!
|
||||
radar_limit=Another radar is found nearby!
|
||||
|
||||
|
||||
[gui]
|
||||
|
@ -21,6 +21,7 @@ local Core = require 'utils.core'
|
||||
local Diff = require 'modules.difficulty_vote_by_amount'
|
||||
local format_number = require 'util'.format_number
|
||||
local RPG_Progression = require 'utils.datastore.rpg_data'
|
||||
local Utils = require 'utils.utils'
|
||||
|
||||
-- tables
|
||||
local WPT = require 'maps.mountain_fortress_v3.table'
|
||||
@ -717,7 +718,7 @@ local mining_events = {
|
||||
|
||||
local function on_player_mined_entity(event)
|
||||
local entity = event.entity
|
||||
local player = game.players[event.player_index]
|
||||
local player = game.get_player(event.player_index)
|
||||
if not player.valid then
|
||||
return
|
||||
end
|
||||
@ -946,7 +947,7 @@ local function on_player_repaired_entity(event)
|
||||
local carriages_numbers = WPT.get('carriages_numbers')
|
||||
|
||||
if carriages_numbers[entity.unit_number] then
|
||||
local player = game.players[event.player_index]
|
||||
local player = game.get_player(event.player_index)
|
||||
local repair_speed = RPG.get_magicka(player)
|
||||
if repair_speed <= 0 then
|
||||
set_train_final_health(-1, true)
|
||||
@ -1393,6 +1394,26 @@ local function on_built_entity(event)
|
||||
return
|
||||
end
|
||||
|
||||
local position = entity.position
|
||||
local player = game.get_player(event.player_index)
|
||||
|
||||
if entity.name == 'radar' then
|
||||
if entity.surface.count_entities_filtered({type = 'radar', position = position, radius = 64}) > 1 then
|
||||
player.surface.create_entity(
|
||||
{
|
||||
name = 'flying-text',
|
||||
position = entity.position,
|
||||
text = ({'entity.radar_limit'}),
|
||||
color = {255, 0, 0}
|
||||
}
|
||||
)
|
||||
|
||||
player.surface.spill_item_stack(position, {name = entity.name, count = 1, true})
|
||||
entity.destroy()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local valid_drills = {
|
||||
['burner-mining-drill'] = true,
|
||||
['electric-mining-drill'] = true
|
||||
@ -1452,7 +1473,6 @@ local function on_built_entity(event)
|
||||
|
||||
upgrades.showed_text = true
|
||||
end
|
||||
local player = game.players[event.player_index]
|
||||
player.insert({name = entity.name, count = 1})
|
||||
entity.destroy()
|
||||
end
|
||||
@ -1471,6 +1491,25 @@ local function on_robot_built_entity(event)
|
||||
return
|
||||
end
|
||||
|
||||
local position = entity.position
|
||||
|
||||
if entity.name == 'radar' then
|
||||
if entity.surface.count_entities_filtered({type = 'radar', position = position, radius = 64}) > 1 then
|
||||
entity.surface.create_entity(
|
||||
{
|
||||
name = 'flying-text',
|
||||
position = entity.position,
|
||||
text = ({'entity.radar_limit'}),
|
||||
color = {255, 0, 0}
|
||||
}
|
||||
)
|
||||
|
||||
entity.surface.spill_item_stack(position, {name = entity.name, count = 1, true})
|
||||
entity.destroy()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local valid_drills = {
|
||||
['burner-mining-drill'] = true,
|
||||
['electric-mining-drill'] = true
|
||||
|
@ -540,24 +540,5 @@ end
|
||||
Event.on_nth_tick(10, on_tick)
|
||||
Event.on_init(on_init)
|
||||
Event.add(WPT.events.reset_map, Public.reset_map)
|
||||
Event.add(
|
||||
defines.events.on_sector_scanned,
|
||||
function(event)
|
||||
local radar = event.radar
|
||||
if not radar or not radar.valid then
|
||||
return
|
||||
end
|
||||
|
||||
local radars_reveal_new_chunks = WPT.get('radars_reveal_new_chunks')
|
||||
if radars_reveal_new_chunks then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = event.chunk_position
|
||||
|
||||
radar.force.cancel_charting(radar.surface.index)
|
||||
radar.force.unchart_chunk(pos, radar.surface.index)
|
||||
end
|
||||
)
|
||||
|
||||
return Public
|
||||
|
Loading…
x
Reference in New Issue
Block a user