-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
231 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
require "defines" | ||
|
||
--[[Debug Functions]]-- | ||
debug_master = false -- Master switch for debugging, shows most things! | ||
function debug(str) | ||
if debug_master then | ||
PlayerPrint(str) | ||
end | ||
end | ||
|
||
function PlayerPrint(message) | ||
for _,player in pairs(game.players) do | ||
player.print(message) | ||
end | ||
end | ||
|
||
game.oninit(function() | ||
|
||
end) | ||
|
||
game.onsave(function() | ||
|
||
end) | ||
|
||
game.onload(function() | ||
|
||
end) | ||
|
||
game.onevent(defines.events.onplayercrafteditem, function(event) | ||
if not glob.CraftedItems then glob.CraftedItems = {} end | ||
if not glob.CraftedItems[event.itemstack.name] then | ||
glob.CraftedItems[event.itemstack.name] = event.itemstack.count | ||
debug("No CraftedItems ("..tostring(event.itemstack.name)..")") | ||
else | ||
glob.CraftedItems[event.itemstack.name] = glob.CraftedItems[event.itemstack.name] + event.itemstack.count | ||
debug("CraftedItems increased by "..tostring(event.itemstack.count).." ("..tostring(event.itemstack.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onplayermineditem, function(event) | ||
if not glob.MinedItems then glob.MinedItems = {} end | ||
if not glob.MinedItems[event.itemstack.name] then | ||
glob.MinedItems[event.itemstack.name] = event.itemstack.count | ||
debug("MinedItems not found".." ("..tostring(event.itemstack.name)..")") | ||
else | ||
glob.MinedItems[event.itemstack.name] = glob.MinedItems[event.itemstack.name] + event.itemstack.count | ||
debug("MinedItems increased by "..tostring(event.itemstack.count).." ("..tostring(event.itemstack.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onrobotmined, function(event) | ||
if not glob.RobotMinedItems then glob.RobotMinedItems = {} end | ||
if not glob.RobotMinedItems[event.itemstack.name] then | ||
glob.RobotMinedItems[event.itemstack.name] = event.itemstack.count | ||
debug("RobotMinedItems not found".." ("..tostring(event.itemstack.name)..")") | ||
else | ||
glob.RobotMinedItems[event.itemstack.name] = glob.RobotMinedItems[event.itemstack.name] + event.itemstack.count | ||
debug("RobotMinedItems increased by "..tostring(event.itemstack.count).." ("..tostring(event.itemstack.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onentitydied, function(event) | ||
if not glob.EntityDied then glob.EntityDied = {} end | ||
if not glob.EntityDied[event.entity.name] then | ||
glob.EntityDied[event.entity.name] = 1 | ||
debug("EntityDied not found".." ("..tostring(event.entity.name)..")") | ||
else | ||
glob.EntityDied[event.entity.name] = glob.EntityDied[event.entity.name] + 1 | ||
debug("EntityDied increased by 1".." ("..tostring(event.entity.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onsectorscanned, function(event) | ||
if not glob.SectorScanned then | ||
glob.SectorScanned = 1 | ||
else | ||
glob.SectorScanned = glob.SectorScanned + 1 | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onmarkedfordeconstruction, function(event) | ||
if not glob.MarkedForDeconstruction then glob.MarkedForDeconstruction = {} end | ||
if not glob.MarkedForDeconstruction[event.entity.name] then | ||
glob.MarkedForDeconstruction[event.entity.name] = 1 | ||
debug("MarkedForDeconstruction not found ("..tostring(event.entity.name)..")") | ||
else | ||
glob.MarkedForDeconstruction[event.entity.name] = glob.MarkedForDeconstruction[event.entity.name] + 1 | ||
debug("MarkedForDeconstruction increased by 1 ("..tostring(event.entity.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.oncanceleddeconstruction, function(event) | ||
if not glob.CanceledDeconstruction then glob.CanceledDeconstruction = {} end | ||
if not glob.CanceledDeconstruction[event.entity.name] then | ||
glob.CanceledDeconstruction[event.entity.name] = 1 | ||
debug("CanceledDeconstruction not found ("..tostring(event.entity.name)..")") | ||
else | ||
glob.CanceledDeconstruction[event.entity.name] = glob.CanceledDeconstruction[event.entity.name] + 1 | ||
debug("CanceledDeconstruction increased by 1 ("..tostring(event.entity.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onpickedupitem, function(event) | ||
if not glob.PickedItems then glob.PickedItems = {} end | ||
if not glob.PickedItems[event.itemstack.name] then | ||
glob.PickedItems[event.itemstack.name] = event.itemstack.count | ||
debug("PickedItems not found ("..tostring(event.itemstack.name)..")") | ||
else | ||
glob.PickedItems[event.itemstack.name] = glob.PickedItems[event.itemstack.name] + event.itemstack.count | ||
debug("PickedItems increased by "..tostring(event.itemstack.count).." ("..tostring(event.itemstack.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.ontick, function(event) | ||
if not glob.timer then glob.timer={seconds=0, minutes=0, hours=0} end | ||
if event.tick%60==0 then | ||
glob.timer.seconds = glob.timer.seconds + 1 | ||
end | ||
if glob.timer.seconds==60 then | ||
glob.timer.seconds = 0 | ||
glob.timer.minutes = glob.timer.minutes + 1 | ||
end | ||
if glob.timer.minutes==60 then | ||
glob.timer.minutes = 0 | ||
glob.timer.hours = glob.timer.hours + 1 | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onbuiltentity, function(event) | ||
if not glob.BuildEntity then glob.BuildEntity = {} end | ||
if glob.BuildEntity[event.createdentity.name] then | ||
glob.BuildEntity[event.createdentity.name] = glob.BuildEntity[event.createdentity.name] + 1 | ||
debug("BuildEntity increased by 1 ("..tostring(event.createdentity.name)..")") | ||
else | ||
glob.BuildEntity[event.createdentity.name] = 1 | ||
debug("BuildEntity not found ("..tostring(event.createdentity.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onrobotbuiltentity, function(event) | ||
if not glob.RobotBuildEntity then glob.RobotBuildEntity = {} end | ||
if glob.RobotBuildEntity[event.createdentity.name] then | ||
glob.RobotBuildEntity[event.createdentity.name] = glob.RobotBuildEntity[event.createdentity.name] + 1 | ||
debug("RobotBuildEntity increased by 1 ("..tostring(event.createdentity.name)..")") | ||
else | ||
glob.RobotBuildEntity[event.createdentity.name] = 1 | ||
debug("RobotBuildEntity not found ("..tostring(event.createdentity.name)..")") | ||
end | ||
end) | ||
|
||
game.onevent(defines.events.onchunkgenerated, function(event) | ||
if not glob.ChunkGenerated then | ||
glob.ChunkGenerated = 1 | ||
else | ||
glob.ChunkGenerated = glob.ChunkGenerated + 1 | ||
end | ||
if debug_chunks then debug("Chunk Generated, chunks counter is now "..tostring(glob.ChunkGenerated)) end | ||
end) | ||
|
||
remote.addinterface("DyTech-Script", | ||
{ | ||
Timer = function(name) | ||
return glob.timer[name] | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- Welcome to the config file of DyTech-Dynamic! | ||
-- Here you can switch any module on or off! | ||
-- The general rule is: TRUE is on, FALSE is off! | ||
|
||
--[[ Research System Toggle ]]-- | ||
-- This is the toggle for the Research System. | ||
-- This system will set all technologies to not unlock a recipe, | ||
-- and lets the Research Handle it! | ||
Research_System = true | ||
|
||
--[[ Extra Toggles for the Research System ]]-- | ||
-- This toggle is for having time as a requirement. | ||
-- Meaning: a recipe can only be unlocked after a specific time has passed. | ||
Research_System_Time_Usage = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
require "config" | ||
|
||
function RemoveFromTech(Name, Recipe) | ||
for k, v in pairs(data.raw["technology"][Name].effects) do | ||
if v.recipe == Recipe then table.remove(data.raw["technology"][Name].effects, k) end | ||
break | ||
end | ||
end | ||
|
||
RemoveFromTech("automation", "assembling-machine-1") | ||
RemoveFromTech("automation", "long-handed-inserter") | ||
RemoveFromTech("automation", "iron-gear-wheel") | ||
if Research_System then | ||
RemoveFromTech("automation", "assembling-machine-1") | ||
RemoveFromTech("automation", "long-handed-inserter") | ||
RemoveFromTech("automation", "iron-gear-wheel") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
not-enough-points=You don't have enough Science Points to unlock this item! | ||
unlocked=You had enough points, so you have unlocked | ||
not-enough-time=Not enough time has passed to unlock this recipe. Please try again later! | ||
unlocked=You had enough points, so you have unlocked | ||
rs-disabled=Research System is NOT ENABLED!!!!! Enable it to use it! | ||
iron-gear-wheel=Iron Gear Wheel | ||
assembling-machine-1=Assembling machine 1 | ||
long-handed-inserter=Long Handed Inserter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters