Last active
April 20, 2017 17:53
-
-
Save justarandomgeek/0ba73bfe74242fa938337f39d2b98247 to your computer and use it in GitHub Desktop.
Disable Peaceful Mode After First Rocket Launch
This file contains hidden or 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
*** control.lua 2016-10-06 09:54:37.000000000 -0400 | |
--- control.lua 2017-04-02 17:08:11.000000000 -0400 | |
*************** | |
*** 36,52 **** | |
--- 36,55 ---- | |
end | |
if global.satellite_sent[force.name] then | |
global.satellite_sent[force.name] = global.satellite_sent[force.name] + 1 | |
else | |
game.set_game_state{game_finished=true, player_won=true, can_continue=true} | |
global.satellite_sent[force.name] = 1 | |
+ -- Disable Peaceful on first rocket launch | |
+ game.surfaces['nauvis'].peaceful_mode=false | |
+ game.forces["enemy"].kill_all_units() | |
end | |
for index, player in pairs(force.players) do | |
if player.gui.left.rocket_score then | |
player.gui.left.rocket_score.rocket_count.caption = tostring(global.satellite_sent[force.name]) | |
else | |
local frame = player.gui.left.add{name = "rocket_score", type = "frame", direction = "horizontal", caption={"score"}} | |
frame.add{name="rocket_count_label", type = "label", caption={"", {"rockets-sent"}, ":"}} | |
frame.add{name="rocket_count", type = "label", caption=tostring(global.satellite_sent[force.name])} | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment