-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added TURD migration code. TURD options changed by a new version can …
…now be reset for free the first 10 hours after loading a game with that new version.
- Loading branch information
Showing
4 changed files
with
35 additions
and
3 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,3 @@ | ||
local turd_migrate = require('__pyalienlife__/scripts/turd/turd-migration') | ||
|
||
turd_migrate('moondrop-upgrade', 'cu') |
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,15 @@ | ||
return function(master_tech_name, sub_tech_name) | ||
local reset_time_in_hours = 10 | ||
local reset_time_in_ticks = reset_time_in_hours * 3600 * 60 | ||
|
||
global.turd_migrations = global.turd_migrations or {} | ||
|
||
for _, force in pairs(game.forces) do | ||
global.turd_migrations[force.index] = global.turd_migrations[force.index] or {} | ||
local turd_bonuses = global.turd_bonuses[force.index] | ||
if turd_bonuses and turd_bonuses[master_tech_name] == sub_tech_name then | ||
global.turd_migrations[force.index][sub_tech_name] = game.tick + reset_time_in_ticks | ||
force.print{'turd.font', {'turd.migrated-alert', {'technology-name.'..master_tech_name}, {'technology-name.'..sub_tech_name}, reset_time_in_hours}} | ||
end | ||
end | ||
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