1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Hail hydra added, more help text

This commit is contained in:
SimonFlapse 2019-03-02 15:17:19 +01:00
parent 5b16c18a2b
commit 92841bc13c
2 changed files with 41 additions and 5 deletions

View File

@ -7,12 +7,21 @@ local compilatrons = {}
local current_messages = {}
local messages = {
['spawn'] = {
'Welcome to Redmew - Quadrants!\n\nUse the GUI in your top left corner to play!',
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron',
'Welcome to Redmew - Quadrants!\n\nUse the GUI in your top left corner to play!',
'How transfer items?\nYou can use underground belts to reach the other side\n\nYou can also drop items across, just use the ´Z´ key',
'Welcome to Redmew - Quadrants!\n\nUse the GUI in your top left corner to play!',
'I\'m really cute'
},
['quadrant1'] = {
'Welcome to Science and Military!\n\nCommand center of military and scientific advancement',
'You can only research in this area\n\nYou would have to import some science packs from other areas',
'You can only craft military items in this area\n\nOther areas depend on you sending military items to them',
'Spare some change?\nGo spend your hard earned coins here at the market',
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron'
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron',
'How transfer items?\nYou can use underground belts to reach the other side\n\nYou can also drop items across, just use the ´Z´ key'
},
['quadrant2'] = {
'Welcome to Intermediate and Mining!\n\nThe only producer of steel and electronic circuits!',
@ -20,7 +29,8 @@ local messages = {
'You can only craft circuits in this area\n\nYou need to export them other areas!',
'Rumors say:\nThis area is extra rich in resources\n\nIt\'s ideal for mining operations',
'Spare some change?\nGo spend your hard earned coins here at the market',
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron'
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron',
'How transfer items?\nYou can use underground belts to reach the other side\n\nYou can also drop items across, just use the ´Z´ key'
},
['quadrant3'] = {
'Welcome to Oil and High Tech!\n\nHome of oil processing and technology',
@ -28,14 +38,16 @@ local messages = {
'You can only craft various high tech items in this ares\n\nYou may need to import a lot of intermediate products!',
'I have heard:\nThis area is a perfect place to launch a rocket\n\nOther areas can provide you the parts you need',
'Spare some change?\nGo spend your hard earned coins here at the market',
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron'
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron',
'How transfer items?\nYou can use underground belts to reach the other side\n\nYou can also drop items across, just use the ´Z´ key'
},
['quadrant4'] = {
'Welcome to Logistics and Transport\n\nHome of spaghetti and trainyards',
'You can only produce logistical items in this area\n\nThe success of the region depends on you exporting these!',
'Did you know?\nMe and my siblings where born here',
'Spare some change?\nGo spend your hard earned coins here at the market',
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron'
'Is the world silent?\nYou need to use the /s command to chat with the entire server\n\nLike this: /s Hello World, I\'m Compilatron',
'How transfer items?\nYou can use underground belts to reach the other side\n\nYou can also drop items across, just use the ´Z´ key'
}
}

View File

@ -9,6 +9,8 @@ local Event = require 'utils.event'
local ScenarioInfo = require 'features.gui.info'
local Recipes = require 'map_gen.maps.quadrants.enabled_recipes'
local CompiHandler = require 'map_gen.maps.quadrants.compilatron_handler'
local Token = require 'utils.token'
local Task = require 'utils.task'
local abs = math.abs
local round = math.round
@ -79,6 +81,8 @@ redmew_config.player_create.join_messages = {
'--------'
}
redmew_config.hail_hydra.enabled = true
local function spawn_market(surface, force, position)
position.x = round(position.x)
position.y = round(position.y - 4)
@ -177,8 +181,28 @@ local function on_research_finished(event)
reset_recipes()
end
local callback_token
local callback
local function spawn_compilatron()
local pos = game.surfaces[2].find_non_colliding_position('compilatron', {-0.5, -0.5}, 1.5, 0.5)
local compi = game.surfaces[2].create_entity {name = 'compilatron', position = pos, force = game.forces.neutral}
CompiHandler.add_compilatron(compi, 'spawn')
log('ADDED!')
end
local function chunk_generated()
Event.remove_removable(defines.events.on_chunk_generated, callback_token)
Task.set_timeout_in_ticks(300, callback)
end
Event.on_init(on_init)
Event.add(defines.events.on_research_finished, on_research_finished)
--Event.add(defines.events.on_player_joined_game, player_created)
callback_token = Token.register(chunk_generated)
callback = Token.register(spawn_compilatron)
Event.add_removable(defines.events.on_chunk_generated, callback_token)
local function quadrants(x, y)
local abs_x = abs(x) - 0.5
@ -192,7 +216,7 @@ local function quadrants(x, y)
for _, entity in ipairs(entities) do
if entity and entity.valid then
if entity.name ~= 'player' then
if entity.name ~= 'player' and entity.name ~= 'compilatron' then
entity.destroy()
end
end