Skip to content

Commit

Permalink
Merge branch 'release/6.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cooldude2606 committed Aug 17, 2020
2 parents cb20d77 + e1087ca commit e33188d
Show file tree
Hide file tree
Showing 216 changed files with 17,422 additions and 4,996 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dev Deploy

on:
push:
branches:
- dev
paths-ignore:
- 'docs/**'
- '.luacheckrc'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Lua
uses: leafo/gh-actions-lua@v5

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v2

- name: Install LDoc
run: luarocks install ldoc 1.4.4-1

- name: Generate Documents
working-directory: docs
run: ldoc -i .

- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
message: "Automatic Doc Update"
add: "./docs/** .luacheckrc"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI PR Checker

on: pull_request

jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_BASE_REF#refs/heads/})"
id: extract_branch

- name: Lint
uses: Roang-zero1/factorio-mod-luacheck@master
with:
luacheckrc_url: https://raw.githubusercontent.com/explosivegaming/scenario/${{ steps.extract_branch.outputs.branch }}/.luacheckrc

docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Lua
uses: leafo/gh-actions-lua@v5

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v2

- name: Install LDoc
run: luarocks install ldoc 1.4.4-1

- name: Generate Documents
working-directory: docs
run: ldoc -i .
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 8 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ do -- Assume Factorio Control Stage as Default
}
end

do -- RedMew and ExpGaming overrides
globals = {
'math', 'table',
'print', 'require', 'unpack', 'inspect', 'loadstring', 'ServerCommands', 'Debug',
'_C', '_DEBUG', '_CHEATS', '_DUMP_ENV', '_LIFECYCLE', '_STAGE',
}
end

do -- Set default prototype files
files['**/data.lua'].std = STD_DATA
files['**/data-updates.lua'].std = STD_DATA
Expand Down
1 change: 0 additions & 1 deletion Factorio-luacheckrc
Submodule Factorio-luacheckrc deleted from 0c0518
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i

| Scenario Version* | Version Name | Factorio Version** |
|---|---|---|
| [v6.1][s6.1] | External Data Overhaul | [v1.0.0][f1.0.0] |
| [v6.0][s6.0] | Gui / 0.18 Overhaul | [v0.18.17][f0.18.17] |
| [v5.10][s5.10] | Data Store Rewrite | [v0.17.71][f0.17.71] |
| [v5.9][s5.9] | Control Modules and Documentation | [v0.17.63][f0.17.63] |
Expand All @@ -80,6 +81,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i

\*\* Factorio versions show the version they were made for, often the minimum requirement.

[s6.1]: https://github.com/explosivegaming/scenario/releases/tag/6.1.0
[s6.0]: https://github.com/explosivegaming/scenario/releases/tag/6.0.0
[s5.10]: https://github.com/explosivegaming/scenario/releases/tag/5.10.0
[s5.9]: https://github.com/explosivegaming/scenario/releases/tag/5.9.0
Expand All @@ -98,6 +100,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i
[s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0
[s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1

[f1.0.0]: https://wiki.factorio.com/Version_history/1.0.0#1.0.0
[f0.18.17]: https://wiki.factorio.com/Version_history/0.18.0#0.18.17
[f0.17.71]: https://wiki.factorio.com/Version_history/0.17.0#0.17.71
[f0.17.63]: https://wiki.factorio.com/Version_history/0.17.0#0.17.63
Expand Down
31 changes: 21 additions & 10 deletions config/_file_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
return {
--'example.file_not_loaded',
'modules.factorio-control', -- base factorio free play scenario
-- Game Commands
'expcore.player_data',

--- Game Commands
'modules.commands.me',
'modules.commands.kill',
'modules.commands.admin-chat',
'modules.commands.tag',
'modules.commands.teleport',
'modules.commands.cheat-mode',
'modules.commands.ratio',
Expand All @@ -25,11 +26,10 @@ return {
'modules.commands.spawn',
'modules.commands.warnings',
'modules.commands.find',
'modules.commands.bonus',
'modules.commands.home',
-- QoL Addons
'modules.addons.station-auto-name',
'modules.addons.greetings',
'modules.commands.connect',

--- Addons
'modules.addons.chat-popups',
'modules.addons.damage-popups',
'modules.addons.death-logger',
Expand All @@ -38,11 +38,21 @@ return {
'modules.addons.compilatron',
'modules.addons.scorched-earth',
'modules.addons.pollution-grading',
'modules.addons.random-player-colours',
'modules.addons.station-auto-name',
'modules.addons.discord-alerts',
'modules.addons.chat-reply',
'modules.addons.tree-decon',
-- GUI

--- Data
'modules.data.statistics',
'modules.data.player-colours',
'modules.data.greetings',
'modules.data.quickbar',
'modules.data.alt-view',
'modules.data.tag',
'modules.data.bonus',

--- GUI
'modules.gui.readme',
'modules.gui.rocket-info',
'modules.gui.science-info',
Expand All @@ -51,10 +61,11 @@ return {
'modules.gui.player-list',
'modules.gui.server-ups',
'modules.commands.debug',
-- Config Files

--- Config Files
'config.expcore.command_auth_admin', -- commands tagged with admin_only are blocked for non admins
'config.expcore.command_auth_roles', -- commands must be allowed via the role config
'config.expcore.command_runtime_disable', -- allows commands to be enabled and disabled during runtime
'config.expcore.permission_groups', -- loads some predefined permission groups
'config.expcore.roles', -- loads some predefined roles
}
}
60 changes: 31 additions & 29 deletions config/advanced_start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,37 @@
--- These are called factories because they return another function
-- use these as a simple methods of adding new items
-- they will do most of the work for you
-- ['item-name']=factory(params)
-- ['item-name'] = factory(params)
-- luacheck:ignore 212/amount_made 212/items_made 212/player

-- Use these to adjust for ticks ie game.tick < 5*minutes
-- luacheck:ignore 211/seconds 211/minutes 211/hours
local seconds, minutes, hours = 60, 3600, 216000

--- Use to make a split point for the number of items given based on time
-- ['stone-furnace']=cutoff_time(5*minutes,4,0) -- before 5 minutes give four items after 5 minutes give none
local function cutoff_time(time,before,after)
return function(amount_made,items_made,player)
-- ['stone-furnace']=cutoff_time(5*minutes, 4,0) -- before 5 minutes give four items after 5 minutes give none
local function cutoff_time(time, before, after)
return function(amount_made, items_made, player)
if game.tick < time then return before
else return after
end
end
end

--- Use to make a split point for the number of items given based on amount made
-- ['firearm-magazine']=cutoff_amount_made(100,10,0) -- give 10 items until 100 items have been made
local function cutoff_amount_made(amount,before,after)
return function(amount_made,items_made,player)
-- ['firearm-magazine']=cutoff_amount_made(100, 10, 0) -- give 10 items until 100 items have been made
local function cutoff_amount_made(amount, before, after)
return function(amount_made, items_made, player)
if amount_made < amount then return before
else return after
end
end
end

--- Same as above but will not give any items if x amount has been made of another item, useful for tiers
-- ['light-armor']=cutoff_amount_made_unless(5,0,1,'heavy-armor',5) -- give light armor once 5 have been made unless 5 heavy armor has been made
local function cutoff_amount_made_unless(amount,before,after,second_item,second_amount)
return function(amount_made,items_made,player)
-- ['light-armor']=cutoff_amount_made_unless(5, 0,1,'heavy-armor',5) -- give light armor once 5 have been made unless 5 heavy armor has been made
local function cutoff_amount_made_unless(amount, before, after, second_item, second_amount)
return function(amount_made, items_made, player)
if items_made(second_item) < second_amount then
if amount_made < amount then return before
else return after
Expand All @@ -43,11 +45,11 @@ local function cutoff_amount_made_unless(amount,before,after,second_item,second_
end

-- Use for mass production items where you want the amount to change based on the amount already made
-- ['iron-plate']=scale_amount_made(5*minutes,10,10) -- for first 5 minutes give 10 items then after apply a factor of 10
local function scale_amount_made(amount,before,scalar)
return function(amount_made,items_made,player)
-- ['iron-plate']=scale_amount_made(5*minutes, 10, 10) -- for first 5 minutes give 10 items then after apply a factor of 10
local function scale_amount_made(amount, before, scalar)
return function(amount_made, items_made, player)
if amount_made < amount then return before
else return (amount_made*scalar)/math.pow(game.tick/minutes,2)
else return (amount_made*scalar)/math.pow(game.tick/minutes, 2)
end
end
end
Expand All @@ -65,30 +67,30 @@ return {
skip_intro=true, --- @setting skip_intro skips the intro given in the default factorio free play scenario
skip_victory=true, --- @setting skip_victory will skip the victory screen when a rocket is launched
disable_base_game_silo_script=true, --- @setting disable_base_game_silo_script will not load the silo script at all
research_queue_from_start=true, --- @setting research_queue_from_start when true the research queue is useible from the start
research_queue_from_start=true, --- @setting research_queue_from_start when true the research queue is useable from the start
friendly_fire=false, --- @setting friendly_fire weather players will be able to attack each other on the same force
enemy_expansion=false, --- @setting enemy_expansion a catch all for in case the map settings file fails to load
chart_radius=10*32, --- @setting chart_radius the number of tiles that will be charted when the map starts
items = { --- @setting items items and there condition for being given
-- ['item-name'] = function(amount_made,production_stats,player) return <Number> end -- 0 means no items given
-- ['item-name'] = function(amount_made, production_stats, player) return <Number> end -- 0 means no items given
-- Plates
['iron-plate']=scale_amount_made(100,10,10),
['copper-plate']=scale_amount_made(100,0,8),
['steel-plate']=scale_amount_made(100,0,4),
['iron-plate']=scale_amount_made(100, 10, 10),
['copper-plate']=scale_amount_made(100, 0,8),
['steel-plate']=scale_amount_made(100, 0,4),
-- Secondary Items
['electronic-circuit']=scale_amount_made(1000,0,6),
['iron-gear-wheel']=scale_amount_made(1000,0,6),
['electronic-circuit']=scale_amount_made(1000, 0,6),
['iron-gear-wheel']=scale_amount_made(1000, 0,6),
-- Starting Items
['burner-mining-drill']=cutoff_time(10*minutes,4,0),
['stone-furnace']=cutoff_time(10*minutes,4,0),
['burner-mining-drill']=cutoff_time(10*minutes, 4,0),
['stone-furnace']=cutoff_time(10*minutes, 4,0),
-- Armor
['light-armor']=cutoff_amount_made_unless(5,0,1,'heavy-armor',5),
['heavy-armor']=cutoff_amount_made(5,0,1),
['light-armor']=cutoff_amount_made_unless(5, 0,1,'heavy-armor',5),
['heavy-armor']=cutoff_amount_made(5, 0,1),
-- Weapon
['pistol']=cutoff_amount_made_unless(0,1,1,'submachine-gun',5),
['submachine-gun']=cutoff_amount_made(5,0,1),
['pistol']=cutoff_amount_made_unless(0, 1,1,'submachine-gun',5),
['submachine-gun']=cutoff_amount_made(5, 0,1),
-- Ammo
['firearm-magazine']=cutoff_amount_made_unless(100,10,0,'piercing-rounds-magazine',100),
['piercing-rounds-magazine']=cutoff_amount_made(100,0,10),
['firearm-magazine']=cutoff_amount_made_unless(100, 10, 0,'piercing-rounds-magazine',100),
['piercing-rounds-magazine']=cutoff_amount_made(100, 0,10),
}
}
Loading

0 comments on commit e33188d

Please sign in to comment.