Skip to content

Instantly share code, notes, and snippets.

@justarandomgeek
Last active April 20, 2017 17:53
Show Gist options
  • Save justarandomgeek/0ba73bfe74242fa938337f39d2b98247 to your computer and use it in GitHub Desktop.
Save justarandomgeek/0ba73bfe74242fa938337f39d2b98247 to your computer and use it in GitHub Desktop.
Disable Peaceful Mode After First Rocket Launch
*** 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