Commit 0b72be4c authored by JuicyJuuce's avatar JuicyJuuce

got it working with Factorio up to 0.17.6

parent 86a0f117
......@@ -66,7 +66,7 @@ config.get_config = function()
oil_only_in_center = true,
no_rush_time = 20,
base_exclusion_time = 0,
fast_blueprinting_time = 20,
fast_blueprinting_time = 0,
disable_starting_blueprints = false,
character_speed_when_hurt = "80%",
tank_speed = "100%",
......@@ -184,8 +184,8 @@ config.get_config = function()
for k, t in pairs (sorted_packs) do
table.insert(data.team_config.research_level.options, t.name)
end
local selected_tier = config.team_config.research_level.options[2]
if selected_tier then config.team_config.research_level.selected = selected_tier end
local selected_tier = data.team_config.research_level.options[2]
if selected_tier then data.team_config.research_level.selected = selected_tier end
data.research_ingredient_list = {}
for k, research in pairs (data.team_config.research_level.options) do
......@@ -368,8 +368,7 @@ config.get_config = function()
{
items =
{
["construction-robot"] = 10,
["deconstruction-planner"] = 1
["construction-robot"] = 10
},
armor = "modular-armor",
equipment =
......@@ -431,22 +430,26 @@ config.give_equipment = function(player, respawn)
local setting = config.script_data.team_config.starting_equipment.selected
if not setting then return end
local player_gear = config.script_data.equipment_list[setting]
for equipment = player_gear, not respawn and player_gear.fast_blueprinting do
if equipment then
if equipment.items then
util.insert_safe(player, equipment.items)
if config.script_data.game_config.fast_blueprinting_time > 0 and player_gear.fast_blueprinting then
player_gear = player_gear.fast_blueprinting
end
--for equipment = player_gear, not respawn and player_gear.fast_blueprinting do
if not respawn then
if player_gear then
if player_gear.items then
util.insert_safe(player, player_gear.items)
end
if equipment.armor then
if player_gear.armor then
local stack = player.get_inventory(defines.inventory.player_armor)[1]
local item = game.item_prototypes[equipment.armor]
local item = game.item_prototypes[player_gear.armor]
if item and item.type == "armor" then
stack.set_stack{name = item.name}
end
if equipment.equipment then
if player_gear.equipment then
local grid = stack.grid
if grid then
local prototypes = game.equipment_prototypes
for name, count in pairs (equipment.equipment) do
for name, count in pairs (player_gear.equipment) do
if prototypes[name] then
for k = 1, count do
grid.put{name = name}
......@@ -519,8 +522,7 @@ local localised_names =
map_height = {"gui-map-generator.map-width-simple"},
map_width = {"gui-map-generator.map-height-simple"},
map_seed = {"gui-map-generator.map-seed-simple"},
starting_area_size = {"gui-map-generator.starting-area"},
technology_price_multiplier = {"gui-map-generator.technology-price-multiplier"}
starting_area_size = {"gui-map-generator.starting-area-size"}
}
-- "" for no tooltip
......
......@@ -25,6 +25,10 @@ script.on_configuration_changed(function()
pvp.on_configuration_changed()
end)
script.on_event(defines.events, function(event)
pvp.on_event(event)
end)
script.on_nth_tick(5, function(event)
pvp.on_nth_tick[5](event)
end)
......
......@@ -72,7 +72,7 @@ no_rush_time_tooltip=Players will be restricted to their respective areas for th
no-rush-begins=The no rush period has begun. Players will be restricted to their starting areas for __1__ minutes.
no-rush-ends=The no rush period has ended.
no-rush-teleport=You cannot leave your starting area before the no rush time. There is __1__ minutes of no rush remaining.
fast_blueprinting_time=Fast blueprinting duration
fast_blueprinting_time=Fast blueprinting duration (bugged)
fast_blueprinting_time_tooltip=Players get very fast construction bots with infinite energy for this many minutes.
fast-blueprinting-begins=The fast blueprinting period has begun. Construction robots are very fast and have infinite energy for __1__ minutes.
fast-blueprinting-ends=The fast blueprinting period has ended.
......@@ -268,3 +268,4 @@ teams=Teams
kill_cowards=Kill cowards
kill_cowards_tooltip=Kill players who disconnect while in combat.
cowards-way-out=__1__ has taken the cowards way out!
technology_price_multiplier=Technology price multiplier
......@@ -305,7 +305,7 @@ function create_config_gui(player)
if not frame.config_holder_button_flow then
local button_flow = frame.add{type = "flow", direction = "horizontal", name = "config_holder_button_flow"}
button_flow.style.horizontally_stretchable = true
button_flow.style.align = "right"
button_flow.style.horizontal_align = "right"
button_flow.style.vertical_align = "bottom"
button_flow.add{type = "button", name = "balance_options", caption = {"balance-options"}, style = "dialog_button"}
button_flow.add{type = "sprite-button", name = "pvp_export_button", sprite = "utility/export_slot", tooltip = {"gui.export-to-string"}, style = "slot_button"}
......@@ -1077,7 +1077,7 @@ function toggle_balance_options_gui(player)
end
local flow = frame.add{type = "flow", direction = "horizontal"}
flow.style.horizontally_stretchable = true
flow.style.align = "right"
flow.style.horizontal_align = "right"
flow.add{type = "button", name = "balance_options_cancel", caption = {"cancel"}, style = "back_button"}
add_pusher(flow)
flow.add{type = "button", name = "balance_options_confirm", caption = {"balance-confirm"}, style = "confirm_button"}
......@@ -2122,7 +2122,7 @@ function check_fast_blueprinting()
end
if starting_equipment == "medium" then
for k, player in pairs (game.players) do
for j, inventory_type in pairs ({"player_main", "player_quickbar", "player_armor"}) do
for j, inventory_type in pairs ({"player_main", "player_armor"}) do
local inventory = player.get_inventory(defines.inventory[inventory_type])
clear_inventory_of_fast_blueprinting_items(inventory)
end
......@@ -3460,7 +3460,7 @@ function recipe_picker_elem_update(gui, player)
local recipe = player.force.recipes[gui.elem_value]
local recipe_frame = frame.add{type = "frame", direction = "vertical", style = "image_frame", name = "recipe_check_frame"}
local title_flow = recipe_frame.add{type = "flow"}
title_flow.style.align = "center"
title_flow.style.horizontal_align = "center"
title_flow.style.horizontally_stretchable = true
title_flow.add{type = "label", caption = recipe.localised_name, style = "frame_caption_label"}
local table = recipe_frame.add{type = "table", column_count = 2, name = "recipe_checker_table"}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment