All File Upto ExpGamingBot follow bolier print

This commit is contained in:
Cooldude2606
2018-09-14 21:25:28 +01:00
parent 6e129c77c5
commit 4392671ce2
29 changed files with 301 additions and 160 deletions

View File

@@ -1,6 +1,10 @@
--- Adds a better method of player starting items based on production levels.
-- @module AdvancedStartingItems@4.0.0
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule
-- made by cooldude - this just allows condidtions on stating items and custom ammounts to be added, ie more iron made means more starting iron
-- Local Varibles
local items = {
['iron-plate']=function(player,made) if tick_to_min(game.tick) < 5 then return 8 else return (made*10)/math.pow(tick_to_min(game.tick),2) end end,
['copper-plate']=function(player,made) if tick_to_min(game.tick) < 5 then return 0 else return (made*8)/math.pow(tick_to_min(game.tick),2) end end,
@@ -18,15 +22,24 @@ local items = {
['iron-axe']=function(player,made) if made > 5 and player.force.item_production_statistics.get_input_count('steel-axe') <= 5 then return 1 else return 0 end end,
['steel-axe']=function(player,made) if made > 5 then return 1 else return 0 end end
}
-- Module Define
local module_verbose = false
local ThisModule = {}
-- Event Handlers Define
Event.register(defines.events.on_player_created, function(event)
local player = game.players[event.player_index]
if event.player_index == 1 then
player.force.friendly_fire = false
game.map_settings.enemy_expansion.enabled = false
player.force.chart(player.surface, {{player.position.x - 400, player.position.y - 400}, {player.position.x + 400, player.position.y + 400}})
end
for item,count in pairs(items) do
if type(count) == 'function' then count = math.floor(count(player,player.force.item_production_statistics.get_input_count(item))) end
if count > 0 then player.insert{name=item, count=count} end
end
end)
local player = game.players[event.player_index]
if event.player_index == 1 then
player.force.friendly_fire = false
game.map_settings.enemy_expansion.enabled = false
player.force.chart(player.surface, {{player.position.x - 400, player.position.y - 400}, {player.position.x + 400, player.position.y + 400}})
end
for item,count in pairs(items) do
if type(count) == 'function' then count = math.floor(count(player,player.force.item_production_statistics.get_input_count(item))) end
if count > 0 then player.insert{name=item, count=count} end
end
end)
-- Module Return
return ThisModule

View File

@@ -0,0 +1,20 @@
{
"name": "AdvancedStartingItems",
"version": "4.0.0",
"type": "Module",
"description": "Adds a better method of player starting items based on production levels.",
"location": "<blank>",
"keywords": [
"Inventory",
"Start",
"Items",
"Player",
"Advanced",
"Useful",
"Balaced"
],
"author": "Cooldude2606",
"contact": "Discord: Cooldude2606#5241",
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
"dependencies": {}
}